search for: nlmsghdr

Displaying 20 results from an estimated 61 matches for "nlmsghdr".

2023 Jul 03
2
[Bug 1691] New: mnl_nlmsg_ok returns true on malformed/incomplete messages leading to potential runtime issues
...ter.org Reporter: eliogovea1993 at gmail.com Consider the following example: source: ``` #include <linux/netfilter.h> #include <assert.h> #include <stdio.h> #include <stdlib.h> #include <libmnl/libmnl.h> int main(int argc, char** argv) { const struct nlmsghdr header = { .nlmsg_len = 0xFFFFFFFF, .nlmsg_type = 0x0000, .nlmsg_flags = 0x0000, .nlmsg_seq = 0x00000000, .nlmsg_pid = 0x00000000 }; assert(!mnl_nlmsg_ok(&header, sizeof(struct nlmsghdr))); return EXIT_SUCCESS; } ``` output: ``` parse-heade...
2006 Jul 25
3
problem in Route add using netlink
...Name) { /* Convert from the standrad numbers and dots notation to binary data */ inet_aton("192.168.51.0", (struct in_addr *)&rinfo->dstAddr); inet_aton("192.168.51.90", (struct in_addr *)&rinfo->gateWay); } int addAttr (struct nlmsghdr *nlhdr, int maxlen, int type, void *data, int alen) { struct rtattr *rta; int len = RTA_LENGTH(alen); if (NLMSG_ALIGN(nlhdr->nlmsg_len) + len > maxlen) return -1; rta = (struct rtattr*)((char *)nlhdr + NLMSG_ALIGN(nlhdr->nlmsg...
2023 Mar 13
1
[Bridge] [PATCH net-next 01/11] net: Add MDB net device operations
...ev. + * int (*ndo_mdb_dump)(struct net_device *dev, struct sk_buff *skb, + * struct netlink_callback *cb); + * Dumps MDB entries from dev. The first argument (marker) in the netlink + * callback is used by core rtnetlink code. + * * int (*ndo_bridge_setlink)(struct net_device *dev, struct nlmsghdr *nlh, * u16 flags, struct netlink_ext_ack *extack) * int (*ndo_bridge_getlink)(struct sk_buff *skb, u32 pid, u32 seq, @@ -1569,6 +1580,16 @@ struct net_device_ops { const unsigned char *addr, u16 vid, u32 portid, u32 seq, struct netlink_ext_ack *ext...
2010 Dec 07
0
[PATCH]: A daemon to support HyperV KVP functionality
...ts, &info); + if (error != 0) { + strcpy(buffer, "getaddrinfo failed\n"); + error = 1; + goto get_domain_done; + } + strcpy(buffer, info->ai_canonname); +get_domain_done: + freeaddrinfo(info); + return error; +} + +static int +netlink_send(int fd, struct cn_msg *msg) +{ + struct nlmsghdr *nlh; + unsigned int size; + struct msghdr message; + char buffer[64]; + struct iovec iov[2]; + + size = NLMSG_SPACE(sizeof(struct cn_msg) + msg->len); + + nlh = (struct nlmsghdr *)buffer; + nlh->nlmsg_seq = 0; + nlh->nlmsg_pid = getpid(); + nlh->nlmsg_type = NLMSG_DONE; + nlh->nlmsg...
2010 Dec 07
0
[PATCH]: A daemon to support HyperV KVP functionality
...ts, &info); + if (error != 0) { + strcpy(buffer, "getaddrinfo failed\n"); + error = 1; + goto get_domain_done; + } + strcpy(buffer, info->ai_canonname); +get_domain_done: + freeaddrinfo(info); + return error; +} + +static int +netlink_send(int fd, struct cn_msg *msg) +{ + struct nlmsghdr *nlh; + unsigned int size; + struct msghdr message; + char buffer[64]; + struct iovec iov[2]; + + size = NLMSG_SPACE(sizeof(struct cn_msg) + msg->len); + + nlh = (struct nlmsghdr *)buffer; + nlh->nlmsg_seq = 0; + nlh->nlmsg_pid = getpid(); + nlh->nlmsg_type = NLMSG_DONE; + nlh->nlmsg...
2010 Dec 08
0
No subject
...&info); + if (error !=3D 0) { + strcpy(buffer, "getaddrinfo failed\n"); + error =3D 1; + goto get_domain_done; + } + strcpy(buffer, info->ai_canonname); +get_domain_done: + freeaddrinfo(info); + return error; +} + +static int +netlink_send(int fd, struct cn_msg *msg) +{ + struct nlmsghdr *nlh; + unsigned int size; + struct msghdr message; + char buffer[64]; + struct iovec iov[2]; + + size =3D NLMSG_SPACE(sizeof(struct cn_msg) + msg->len); + + nlh =3D (struct nlmsghdr *)buffer; + nlh->nlmsg_seq =3D 0; + nlh->nlmsg_pid =3D getpid(); + nlh->nlmsg_type =3D NLMSG_DONE; + nlh...
2010 Dec 08
0
No subject
...&info); + if (error !=3D 0) { + strcpy(buffer, "getaddrinfo failed\n"); + error =3D 1; + goto get_domain_done; + } + strcpy(buffer, info->ai_canonname); +get_domain_done: + freeaddrinfo(info); + return error; +} + +static int +netlink_send(int fd, struct cn_msg *msg) +{ + struct nlmsghdr *nlh; + unsigned int size; + struct msghdr message; + char buffer[64]; + struct iovec iov[2]; + + size =3D NLMSG_SPACE(sizeof(struct cn_msg) + msg->len); + + nlh =3D (struct nlmsghdr *)buffer; + nlh->nlmsg_seq =3D 0; + nlh->nlmsg_pid =3D getpid(); + nlh->nlmsg_type =3D NLMSG_DONE; + nlh...
2010 Dec 17
0
[PATCH 4/4] Staging: hv: Add a user-space daemon to support key/value pair (KVP)
...ts, &info); + if (error != 0) { + strcpy(buffer, "getaddrinfo failed\n"); + error = 1; + goto get_domain_done; + } + strcpy(buffer, info->ai_canonname); +get_domain_done: + freeaddrinfo(info); + return error; +} + +static int +netlink_send(int fd, struct cn_msg *msg) +{ + struct nlmsghdr *nlh; + unsigned int size; + struct msghdr message; + char buffer[64]; + struct iovec iov[2]; + + size = NLMSG_SPACE(sizeof(struct cn_msg) + msg->len); + + nlh = (struct nlmsghdr *)buffer; + nlh->nlmsg_seq = 0; + nlh->nlmsg_pid = getpid(); + nlh->nlmsg_type = NLMSG_DONE; + nlh->nlmsg...
2010 Dec 17
0
[PATCH 4/4] Staging: hv: Add a user-space daemon to support key/value pair (KVP)
...ts, &info); + if (error != 0) { + strcpy(buffer, "getaddrinfo failed\n"); + error = 1; + goto get_domain_done; + } + strcpy(buffer, info->ai_canonname); +get_domain_done: + freeaddrinfo(info); + return error; +} + +static int +netlink_send(int fd, struct cn_msg *msg) +{ + struct nlmsghdr *nlh; + unsigned int size; + struct msghdr message; + char buffer[64]; + struct iovec iov[2]; + + size = NLMSG_SPACE(sizeof(struct cn_msg) + msg->len); + + nlh = (struct nlmsghdr *)buffer; + nlh->nlmsg_seq = 0; + nlh->nlmsg_pid = getpid(); + nlh->nlmsg_type = NLMSG_DONE; + nlh->nlmsg...
2004 Aug 11
9
ARP limit ?
what is the limit on the arp cache entires ?! Does someone have very big LANs with linux-routers ? How big ? (i mean flat L2 network, not segmented) I want to know how much can my net can scale ? thanx _______________________________________________ LARTC mailing list / LARTC@mailman.ds9a.nl http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/
2012 Dec 07
3
[Bridge] [PATCH net-next v4] bridge: export multicast database via netlink
...est2); + skip: + idx++; + } + } + +out: + cb->args[1] = idx; + cb->args[2] = mdb->seq; + nla_nest_end(skb, nest); + return err; +} + +static int br_mdb_dump(struct sk_buff *skb, struct netlink_callback *cb) +{ + struct net_device *dev; + struct net *net = sock_net(skb->sk); + struct nlmsghdr *nlh; + int idx = 0, s_idx; + + s_idx = cb->args[0]; + + rcu_read_lock(); + + for_each_netdev_rcu(net, dev) { + if (dev->priv_flags & IFF_EBRIDGE) { + struct br_port_msg *bpm; + + if (idx < s_idx) + goto skip; + + nlh = nlmsg_put(skb, NETLINK_CB(cb->skb).portid, + cb-&...
2013 Feb 13
14
[Bridge] [PATCH v10 net-next 00/12] VLAN filtering/VLAN aware bridge
Changes since v9: * series re-ordering so make functionality more distinct. Basic vlan filtering is patches 1-4. Support for PVID/untagged vlans is patches 5 and 6. VLAN support for FDB/MDB is patches 7-11. Patch 12 is still additional egress policy. * Slight simplification to code that extracts the VID from skb. Since we now depend on the vlan module, at the time of input skb_tci is
2012 Nov 27
3
[Bridge] [RFC PATCH 1/2] bridge: export port_no and port_id via IFA_INFO_DATA
Based on net-next. This patch exports port->port_no port->port_id in the end of IFA_INFO_DATA. Cc: Herbert Xu <herbert at gondor.apana.org.au> Cc: Stephen Hemminger <shemminger at vyatta.com> Cc: "David S. Miller" <davem at davemloft.net> Cc: Thomas Graf <tgraf at suug.ch> Cc: Jesper Dangaard Brouer <brouer at redhat.com> Signed-off-by: Cong Wang
2012 Dec 10
0
[Bridge] [PATCH v5] iproute2: add mdb sub-command to bridge
...or.o link.o +BROBJ = bridge.o fdb.o monitor.o link.o mdb.o include ../Config diff --git a/bridge/br_common.h b/bridge/br_common.h index ce11a0b..71f7caf 100644 --- a/bridge/br_common.h +++ b/bridge/br_common.h @@ -5,11 +5,12 @@ extern int print_fdb(const struct sockaddr_nl *who, struct nlmsghdr *n, void *arg); extern int do_fdb(int argc, char **argv); +extern int do_mdb(int argc, char **argv); extern int do_monitor(int argc, char **argv); extern int preferred_family; extern int show_stats; -extern int show_detail; +extern int show_details; extern int timestamp; extern struct rtn...
2012 Dec 05
2
[Bridge] [PATCH net-next v3] bridge: export multicast database via netlink
...est2); + skip: + idx++; + } + } + +out: + cb->args[1] = idx; + cb->args[2] = mdb->seq; + nla_nest_end(skb, nest); + return err; +} + +static int br_mdb_dump(struct sk_buff *skb, struct netlink_callback *cb) +{ + struct net_device *dev; + struct net *net = sock_net(skb->sk); + struct nlmsghdr *nlh; + int idx = 0, s_idx; + + s_idx = cb->args[0]; + + rcu_read_lock(); + + for_each_netdev_rcu(net, dev) { + if (dev->priv_flags & IFF_EBRIDGE) { + struct br_port_msg *bpm; + + if (idx < s_idx) + goto cont; + + nlh = nlmsg_put(skb, NETLINK_CB(cb->skb).portid, + cb-&...
2013 Jan 09
16
[Bridge] [PATCH net-next V5 00/14] Add basic VLAN support to bridges
This series of patches provides an ability to add VLANs to the bridge ports. This is similar to what can be found in most switches. The bridge port may have any number of VLANs added to it including vlan 0 priority tagged traffic. When vlans are added to the port, only traffic tagged with particular vlan will forwarded over this port. Additionally, vlan ids are added to FDB entries and become
2006 Jan 03
2
match mark problem still resists
...match inside ''parse_selector'' that is treated differently from other matches? All except ''mark'' is parsed like parse_xxxx(&argc, &argv, sel, ..) and mark is parsed parse_mark(&argc, &argv, n,..) where sel is a struct tc_u32_sel and n is a struct nlmsghdr. I should say that this deserves at least an "You idiot, you are using it the wrong way. Do like this and stop bothering me!" answer. Sorry my tempestuous attitude. Frustratedly -- Ethy H. Brito /"\ InterNexo Ltda. \ / CAMPANHA DA FITA ASCII - CONTRA MAIL HTML +...
2017 Oct 12
0
[ANNOUNCE] libnftnl 1.0.8 release
...(1): src: add TCP option matching requirements Pablo M. Bermudo Garay (1): src: limit stateful object support Pablo Neira Ayuso (11): src: get rid of aliases and compat include: refresh nf_tables.h copy common: get rid of nftnl_batch_build_hdr() common: return nlmsghdr in nftnl_batch_{begin,end}() rule: add NFTA_RULE_ID attribute udata: add nftnl_udata_put_u32() and nftnl_udata_get_u32() buffer: use nftnl_expr_snprintf() from nftnl_buf_expr() expr: no need to nul-terminate buffer from expression ->snprintf indirection src: no need...
2010 Nov 08
18
implementation of IEEE 802.1Qbg in lldpad
Hi, this set of patches contains the initial implementation of the IEEE 802.1Qbg standard: code for the exchange of EVB TLVs in LLDP frames to negotiate VSI capabalities as well as VDP VSI TLVs between a host with virtual machines and an adjacent switch. It supports setting the parameters of the TLV exchange from the command line using lldptool. VDP profiles consisting of
2010 Nov 08
18
implementation of IEEE 802.1Qbg in lldpad
Hi, this set of patches contains the initial implementation of the IEEE 802.1Qbg standard: code for the exchange of EVB TLVs in LLDP frames to negotiate VSI capabalities as well as VDP VSI TLVs between a host with virtual machines and an adjacent switch. It supports setting the parameters of the TLV exchange from the command line using lldptool. VDP profiles consisting of