26 Apr, 2007

5 commits

  • - make the following needlessly global variables static:
    - core/rtnetlink.c: struct rtnl_msg_handlers[]
    - netfilter/nf_conntrack_proto.c: struct nf_ct_protos[]
    - make the following needlessly global functions static:
    - core/rtnetlink.c: rtnl_dump_all()
    - netlink/af_netlink.c: netlink_queue_skip()

    Signed-off-by: Adrian Bunk
    Signed-off-by: Andrew Morton
    Signed-off-by: David S. Miller

    Adrian Bunk
     
  • This patch introduces a new NLA_BINARY attribute policy type with the
    verification of simply checking the maximum length of the payload.

    It also fixes a small typo in the example.

    Signed-off-by: Johannes Berg
    Signed-off-by: Thomas Graf
    Signed-off-by: David S. Miller

    Johannes Berg
     
  • The error pointer argument in netlink message handlers is used
    to signal the special case where processing has to be interrupted
    because a dump was started but no error happened. Instead it is
    simpler and more clear to return -EINTR and have netlink_run_queue()
    deal with getting the queue right.

    nfnetlink passed on this error pointer to its subsystem handlers
    but only uses it to signal the start of a netlink dump. Therefore
    it can be removed there as well.

    This patch also cleans up the error handling in the affected
    message handlers to be consistent since it had to be touched anyway.

    Signed-off-by: Thomas Graf
    Signed-off-by: David S. Miller

    Thomas Graf
     
  • Signed-off-by: Arnaldo Carvalho de Melo
    Signed-off-by: David S. Miller

    Arnaldo Carvalho de Melo
     
  • So that it is also an offset from skb->head, reduces its size from 8 to 4 bytes
    on 64bit architectures, allowing us to combine the 4 bytes hole left by the
    layer headers conversion, reducing struct sk_buff size to 256 bytes, i.e. 4
    64byte cachelines, and since the sk_buff slab cache is SLAB_HWCACHE_ALIGN...
    :-)

    Many calculations that previously required that skb->{transport,network,
    mac}_header be first converted to a pointer now can be done directly, being
    meaningful as offsets or pointers.

    Signed-off-by: Arnaldo Carvalho de Melo
    Signed-off-by: David S. Miller

    Arnaldo Carvalho de Melo
     

04 Dec, 2006

1 commit


03 Dec, 2006

2 commits

  • Extends the netlink interface to support the __le16 type and
    converts address addition, deletion and, dumping to use the
    new netlink interface.

    Fixes multiple occasions of possible illegal memory references
    due to not validated netlink attributes.

    Signed-off-by: Thomas Graf
    Signed-off-by: David S. Miller

    Thomas Graf
     
  • Account for the netlink message header size directly in nlmsg_new()
    instead of relying on the caller calculate it correctly.

    Replaces error handling of message construction functions when
    constructing notifications with bug traps since a failure implies
    a bug in calculating the size of the skb.

    Signed-off-by: Thomas Graf
    Acked-by: Paul Moore
    Signed-off-by: David S. Miller

    Thomas Graf
     

29 Sep, 2006

1 commit


26 Sep, 2006

2 commits


23 Sep, 2006

6 commits

  • Introduces a new attribute type NLA_NUL_STRING to support NUL
    terminated strings. Attributes of this kind require to carry
    a terminating NUL within the maximum specified in the policy.

    The `old' NLA_STRING which is not required to be NUL terminated
    is extended to provide means to specify a maximum length of the
    string.

    Aims at easing the pain with using nla_strlcpy() on temporary
    buffers.

    Signed-off-by: Thomas Graf
    Signed-off-by: David S. Miller

    Thomas Graf
     
  • This patch removes the 'value' argument from NLA_PUT_FLAG which is
    unused anyway. The documentation comment was already correct so it
    doesn't need an update :)

    Signed-off-by: Johannes Berg
    Signed-off-by: David S. Miller

    Johannes Berg
     
  • Introduces struct fib_config replacing the ugly struct kern_rta
    prone to ordering issues. Avoids creating faked netlink messages
    for auto generated routes or requests via ioctl.

    A new interface net/nexthop.h is added to help navigate through
    nexthop configuration arrays.

    A new struct nl_info will be used to carry the necessary netlink
    information to be used for notifications later on.

    Signed-off-by: Thomas Graf
    Signed-off-by: David S. Miller

    Thomas Graf
     
  • Adds rtnl_notify() to send rtnetlink notification messages and
    rtnl_set_sk_err() to report notification errors as socket
    errors in order to indicate the need of a resync due to loss
    of events.

    nlmsg_report() is added to properly document the meaning of
    NLM_F_ECHO.

    Signed-off-by: Thomas Graf
    Signed-off-by: David S. Miller

    Thomas Graf
     
  • Adds nlmsg_notify() implementing proper notification logic. The
    message is multicasted to all listeners in the group. The
    applications the requests orignates from can request a unicast
    back report in which case said socket will be excluded from the
    multicast to avoid duplicated notifications.

    nlmsg_multicast() is extended to take allocation flags to
    allow notification in atomic contexts.

    Signed-off-by: Thomas Graf
    Signed-off-by: David S. Miller

    Thomas Graf
     
  • Adds:
    nlmsg_get_pos() return current position in message
    nlmsg_trim() trim part of message
    nla_reserve_nohdr(skb, len) reserve room for an attribute w/o hdr
    nla_put_nohdr(skb, len, data) add attribute w/o hdr
    nla_find_nested() find attribute in nested attributes

    Fixes nlmsg_new() to take allocation flags and consider size.

    Signed-off-by: Thomas Graf
    Signed-off-by: David S. Miller

    Thomas Graf
     

10 Nov, 2005

2 commits

  • Introduces netlink_run_queue() to handle the receive queue of
    a netlink socket in a generic way. Processes as much as there
    was in the queue upon entry and invokes a callback function
    for each netlink message found. The callback function may
    refuse a message by returning a negative error code but setting
    the error pointer to 0 in which case netlink_run_queue() will
    return with a qlen != 0.

    Signed-off-by: Thomas Graf
    Signed-off-by: David S. Miller

    Thomas Graf
     
  • Introduces a new type-safe interface for netlink message and
    attributes handling. The interface is fully binary compatible
    with the old interface towards userspace. Besides type safety,
    this interface features attribute validation capabilities,
    simplified message contstruction, and documentation.

    The resulting netlink code should be smaller, less error prone
    and easier to understand.

    Signed-off-by: Thomas Graf
    Signed-off-by: David S. Miller

    Thomas Graf