Re: [PATCH bpf-next v4 0/2] libbpf: adding AF_XDP support
Hi Magnus, > * In a future release, I am planning on adding a higher level data > plane interface too. This will be based around recvmsg and sendmsg > with the use of struct iovec for batching, without the user having > to know anything about the underlying four rings of an AF_XDP > socket. There will be one semantic difference though from the > standard recvmsg and that is that the kernel will fill in the iovecs > instead of the application. But the rest should be the same as the > libc versions so that application writers feel at home. You might consider recvmmsg() and sendmmsg() (bulk of multi segments packets?) Jean-Mickael
Re: (usagi-core 31424) Re: [PATCH 7/13] [RFC] [IPV6] Move source address selection into route lookup.
[ reposted, with better subject ] http://testlab.linux-ipv6.org/tahi-autorun.2/net-2.6_20061018/ The host testlab.linux-ipv6.org doesn't seem to be visible to the outside world so could you post the results somewhere where I could take a closer look at the results? It is visible world-wide, assuming you have IPv6 connection. With IPv4-only connection, one can try to append ".ipv4.sixxs.org": http://testlab.linux-ipv6.org.ipv4.sixxs.org/tahi-autorun.2/net-2.6_20061018/ Jean-Mickael - To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: !! SPAM Suspect : SPAM-URL-DBL !! Re: (usagi-core 31424) Re: [PATCH 7/13] [RFC] [IPV6] Move source address selection into route lookup.
The host testlab.linux-ipv6.org doesn't seem to be visible to the outside world so could you post the results somewhere where I could take a closer look at the results? It is visible world-wide, assuming you have IPv6 connection. With IPv4-only connection, one can try to append ".ipv4.sixxs.org": http://testlab.linux-ipv6.org.ipv4.sixxs.org/tahi-autorun.2/net-2.6_20061018/ Jean-Mickael - To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH 7/13] [RFC] [IPV6] Move source address selection into route lookup.
David Miller wrote: From: Ville Nuorvala <[EMAIL PROTECTED]> Date: Tue, 17 Oct 2006 03:13:17 +0300 This patch moves the normal source address selection from ip6_dst_lookup() into ip6_pol_route_output(), but shouldn't change the routing or source address selection behavior in any way. Signed-off-by: Ville Nuorvala <[EMAIL PROTECTED]> Although this conversion is very clean and the next patch is very logic, I'm going to hold on all patches from 7 onward so there is some time for some discussion of the RFC'ness of them :-) With regard to RFC'ness, passing self tests TAHI "Ready Logo 2" with SUBTREE turned on could be a valuable feedback. Jean-Mickael - To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: drivers/net/wireless/d80211: Check configuration type in hw->config_interface.
When submitting a patch, please state what drivers you are really changing, your mail subject suggested a change to the dscape stack itself. Since I look at those patches at an irregular basis, while I am always checking for rt2x00 related patches I could have missed this one. Especially when you don't CC the driver maintainers about the patch for their drivers. Also I think most people would prefer if you split up patches when it affects multiple drivers, in this case rt2x00 and adm8211. what I meant with this title is this patch is for all d80211-based current drivers of Linville's wireless-dev, but I see your point... diff --git a/drivers/net/wireless/d80211/rt2x00/rt2400pci.c b/drivers/net/wireless/d80211/rt2x00/rt2400pci.c index 946cf86..1d45851 100644 --- a/drivers/net/wireless/d80211/rt2x00/rt2400pci.c +++ b/drivers/net/wireless/d80211/rt2x00/rt2400pci.c @@ -1877,7 +1877,9 @@ rt2400pci_config_interface(struct net_de if (rt2x00pci->type == IEEE80211_IF_TYPE_MNTR) return 0; -rt2400pci_config_bssid(rt2x00pci, conf->bssid); +if (conf->type == IEEE80211_IF_TYPE_STA || +conf->type == IEEE80211_IF_TYPE_IBSS) +rt2400pci_config_bssid(rt2x00pci, conf->bssid); Should rt2400pci_config_bssid not simply run a check to see if the bssid argument is valid? This would prevent the risk of having a similar problem when the function is called from somewhere else as well. I was thinking a function named xxx_config_bssid() assumes a valid bssid pointer, - I would even add BUG_ON(conf->bssid==NULL) in xxx_config_bssid(). And hw->interface already already some tests with conf->type. And net/d80211 uses same kind of test before setting conf->bssid. anyway I don't mind you make the patch the other way. Same comment applies for rt2500pci and rt61pci. Any particular reason why you applied this change to PCI drivers in rt2x00 only and not to the USB drivers? likely because I have only a pci card :-) USB drivers needs same change too. Thanks, Jean-Mickael - To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH] drivers/net/wireless/d80211: Check configuration type in hw->config_interface.
Hello, This patch prevents a NULL pointer dereferencing in AP mode: ieee80211_if_config will set conf->bssid only if device is of type STA or IBSS. I see it using following commands right after module loading (with rt61) # iwconfig wlan0 mode Master # ifconfig wlan0 up Signed-off-by: Jean-Mickael Guerin <[EMAIL PROTECTED]> adm8211/adm8211.c |4 +++- rt2x00/rt2400pci.c |4 +++- rt2x00/rt2500pci.c |4 +++- rt2x00/rt61pci.c |4 +++- 4 files changed, 12 insertions(+), 4 deletions(-) diff --git a/drivers/net/wireless/d80211/adm8211/adm8211.c b/drivers/net/wireless/d80211/adm8211/adm8211.c index 9fc5da7..53f05c2 100644 --- a/drivers/net/wireless/d80211/adm8211/adm8211.c +++ b/drivers/net/wireless/d80211/adm8211/adm8211.c @@ -1469,7 +1469,9 @@ static int adm8211_config_interface(stru { struct adm8211_priv *priv = ieee80211_dev_hw_data(dev); -if (memcmp(conf->bssid, priv->bssid, ETH_ALEN)) { +if ((conf->type == IEEE80211_IF_TYPE_STA || + conf->type == IEEE80211_IF_TYPE_IBSS) && + memcmp(conf->bssid, priv->bssid, ETH_ALEN)) { adm8211_set_bssid(dev, conf->bssid); memcpy(priv->bssid, conf->bssid, ETH_ALEN); } diff --git a/drivers/net/wireless/d80211/rt2x00/rt2400pci.c b/drivers/net/wireless/d80211/rt2x00/rt2400pci.c index 946cf86..1d45851 100644 --- a/drivers/net/wireless/d80211/rt2x00/rt2400pci.c +++ b/drivers/net/wireless/d80211/rt2x00/rt2400pci.c @@ -1877,7 +1877,9 @@ rt2400pci_config_interface(struct net_de if (rt2x00pci->type == IEEE80211_IF_TYPE_MNTR) return 0; -rt2400pci_config_bssid(rt2x00pci, conf->bssid); +if (conf->type == IEEE80211_IF_TYPE_STA || +conf->type == IEEE80211_IF_TYPE_IBSS) +rt2400pci_config_bssid(rt2x00pci, conf->bssid); return 0; } diff --git a/drivers/net/wireless/d80211/rt2x00/rt2500pci.c b/drivers/net/wireless/d80211/rt2x00/rt2500pci.c index ca0edd5..8d2b3a7 100644 --- a/drivers/net/wireless/d80211/rt2x00/rt2500pci.c +++ b/drivers/net/wireless/d80211/rt2x00/rt2500pci.c @@ -2000,7 +2000,9 @@ rt2500pci_config_interface(struct net_de if (conf->type == IEEE80211_IF_TYPE_MNTR) return 0; -rt2500pci_config_bssid(rt2x00pci, conf->bssid); +if (conf->type == IEEE80211_IF_TYPE_STA || +conf->type == IEEE80211_IF_TYPE_IBSS) +rt2500pci_config_bssid(rt2x00pci, conf->bssid); return 0; } diff --git a/drivers/net/wireless/d80211/rt2x00/rt61pci.c b/drivers/net/wireless/d80211/rt2x00/rt61pci.c index 0799f9f..47b2eaf 100644 --- a/drivers/net/wireless/d80211/rt2x00/rt61pci.c +++ b/drivers/net/wireless/d80211/rt2x00/rt61pci.c @@ -2463,7 +2463,9 @@ rt61pci_config_interface(struct net_devi if (conf->type == IEEE80211_IF_TYPE_MNTR) return 0; -rt61pci_config_bssid(rt2x00pci, conf->bssid); +if (conf->type == IEEE80211_IF_TYPE_STA || +conf->type == IEEE80211_IF_TYPE_IBSS) +rt61pci_config_bssid(rt2x00pci, conf->bssid); return 0; } - To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH] shutting down an interface should remove ipv4 addresses
Addresses are owned by the "host" not a particular device, even though they are assosciated with a particular interface. Linux defaults to using the host based addressing model instead of the interface based addressing model. It is true for IPv4, but IPv6 addresses are removed when interface goes down, right ? Regards, Jean-Mickael - To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: about cached dst in ip6_tunnel
Sorry the patch looks corrupted so I repost with attachment. Jean-Mickael -- [IPV6] ip6ip6_tnl_dst_check() : invalidate dst cache whenever xfrm policies change Signed-off-by: [EMAIL PROTECTED] diff --git a/include/net/ip6_tunnel.h b/include/net/ip6_tunnel.h index 29c9da7..5bc6e98 100644 --- a/include/net/ip6_tunnel.h +++ b/include/net/ip6_tunnel.h @@ -27,6 +27,7 @@ struct ip6_tnl { struct flowi fl;/* flowi template for xmit */ struct dst_entry *dst_cache;/* cached dst */ u32 dst_cookie; + u32 fl_genid; }; /* Tunnel encapsulation limit destination sub-option */ diff --git a/net/ipv6/ip6_tunnel.c b/net/ipv6/ip6_tunnel.c index 4859753..ded9c52 100644 --- a/net/ipv6/ip6_tunnel.c +++ b/net/ipv6/ip6_tunnel.c @@ -92,8 +92,9 @@ static inline struct dst_entry *ip6_tnl_ { struct dst_entry *dst = t->dst_cache; - if (dst && dst->obsolete && - dst->ops->check(dst, t->dst_cookie) == NULL) { + if ((dst && dst->obsolete && + dst->ops->check(dst, t->dst_cookie) == NULL) || + t->fl_genid != atomic_read(&flow_cache_genid)) { t->dst_cache = NULL; dst_release(dst); return NULL; @@ -114,6 +115,7 @@ static inline void ip6_tnl_dst_store(str t->dst_cookie = rt->rt6i_node ? rt->rt6i_node->fn_sernum : 0; dst_release(t->dst_cache); t->dst_cache = dst; + t->fl_genid = atomic_read(&flow_cache_genid); } /**
about cached dst in ip6_tunnel
In ip6ip6_tnl_xmit(), we do not xfrm_lookup() when the dst has been stored in cache. If cache is filled before a security policy such ipsec transport mode on end points is added, and no routing changes happen, how to invalidate the cache to trigger a new xfrm_lookup()? I would check flow_cachegenid when testing the cache, like this patch. But I wonder if we can get rid of new field in ip6_tnl and retrieve directly genid from cached dst entry, if ever this patch is really needed :-) Comments are welcome. Jean-Mickael -- [IPV6] ip6ip6_tnl_dst_check() : invalidate dst cache whenever xfrm policies change Signed-off-by: [EMAIL PROTECTED] diff --git a/include/net/ip6_tunnel.h b/include/net/ip6_tunnel.h index 29c9da7..5bc6e98 100644 --- a/include/net/ip6_tunnel.h +++ b/include/net/ip6_tunnel.h @@ -27,6 +27,7 @@ struct ip6_tnl { struct flowi fl;/* flowi template for xmit */ struct dst_entry *dst_cache;/* cached dst */ u32 dst_cookie; + u32 fl_genid; }; /* Tunnel encapsulation limit destination sub-option */ diff --git a/net/ipv6/ip6_tunnel.c b/net/ipv6/ip6_tunnel.c index 4859753..ded9c52 100644 --- a/net/ipv6/ip6_tunnel.c +++ b/net/ipv6/ip6_tunnel.c @@ -92,8 +92,9 @@ static inline struct dst_entry *ip6_tnl_ { struct dst_entry *dst = t->dst_cache; - if (dst && dst->obsolete && - dst->ops->check(dst, t->dst_cookie) == NULL) { + if ((dst && dst->obsolete && + dst->ops->check(dst, t->dst_cookie) == NULL) || + t->fl_genid != atomic_read(&flow_cache_genid)) { t->dst_cache = NULL; dst_release(dst); return NULL; @@ -114,6 +115,7 @@ static inline void ip6_tnl_dst_store(str t->dst_cookie = rt->rt6i_node ? rt->rt6i_node->fn_sernum : 0; dst_release(t->dst_cache); t->dst_cache = dst; + t->fl_genid = atomic_read(&flow_cache_genid); } /** - To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: Fw: IPv6: to take care of permanent routes
Sorry, but I don't think this patch is needed. It is OK to add a route with the RTF_EXPIRES flag set and rtmsg_info == 0. It's simply a route that expires straight away. So there is no inconsistency in allowing this. I agree In fact if anything we should find a way to export the RTF_EXPIRES flag in rt6_fill_node. As it is I don't see how the user can distinguish between a route that never expires versus a route that has just expired. Actually the rt6i_expires check in rt6_fill_node is wrong. It will cause a route that expires at jiffies == 0 (remember jiffies do wrap around) to show as a route that is either permanent or has just expired. It should be checking the RTF_EXPIRES flag instead. Yes I see your point. Using RTF_EXPIRE flag should not be too hard since we have the route entry 'rt' in this function. Thanks, Jean-Mickael - To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
IPv6: avoid dereference of null route entry in ipv6_del_addr()
Hi, This patch fixes potential null pointer dereference (I never experiment such crash). The patch is made for net-2.6.17. Regards, Jean-Mickael Signed-off-by: [EMAIL PROTECTED] -- diff --git a/net/ipv6/addrconf.c b/net/ipv6/addrconf.c index 8df9eb9..8393f45 100644 --- a/net/ipv6/addrconf.c +++ b/net/ipv6/addrconf.c @@ -716,16 +716,18 @@ static void ipv6_del_addr(struct inet6_i ipv6_addr_prefix(&prefix, &ifp->addr, ifp->prefix_len); rt = rt6_lookup(&prefix, NULL, ifp->idev->dev->ifindex, 1); - if (rt && ((rt->rt6i_flags & (RTF_GATEWAY | RTF_DEFAULT)) == 0)) { - if (onlink == 0) { - ip6_del_rt(rt, NULL, NULL, NULL); - rt = NULL; - } else if (!(rt->rt6i_flags & RTF_EXPIRES)) { - rt->rt6i_expires = expires; - rt->rt6i_flags |= RTF_EXPIRES; + if (rt) { + if ((rt->rt6i_flags & (RTF_GATEWAY | RTF_DEFAULT)) == 0) { + if (onlink == 0) { + ip6_del_rt(rt, NULL, NULL, NULL); + rt = NULL; + } else if (!(rt->rt6i_flags & RTF_EXPIRES)) { + rt->rt6i_expires = expires; + rt->rt6i_flags |= RTF_EXPIRES; + } } + dst_release(&rt->u.dst); } - dst_release(&rt->u.dst); } in6_ifa_put(ifp);
Re: IPv6: to take care of permanent routes
Probably, the caller should not set RTF_EXPIRES when allocating new one. Instead, set rt6i_expires and RTF_EXPIRES afterwards (as your patch does). It makes sense. And, please make your patch so that we can apply it by "patch -p1" at the top directory of the tree; e.g. % diff -u linux-2.6.15.{orig,fix}/net/ipv6/route.c > fix.patch Here it is. Signed-off-by: [EMAIL PROTECTED] -- --- linux-2.6.15-orig/net/ipv6/ndisc.c 2006-01-03 04:21:10.0 +0100 +++ linux-2.6.15/net/ipv6/ndisc.c 2006-01-26 17:51:49.811283931 +0100 @@ -1119,8 +1119,10 @@ neigh->flags |= NTF_ROUTER; } - if (rt) + if (rt) { rt->rt6i_expires = jiffies + (HZ * lifetime); + rt->rt6i_flags |= RTF_EXPIRES; + } if (ra_msg->icmph.icmp6_hop_limit) { in6_dev->cnf.hop_limit = ra_msg->icmph.icmp6_hop_limit; --- linux-2.6.15-orig/net/ipv6/route.c 2006-01-03 04:21:10.0 +0100 +++ linux-2.6.15/net/ipv6/route.c 2006-01-26 17:51:21.606054467 +0100 @@ -832,7 +832,10 @@ } rt->u.dst.obsolete = -1; - rt->rt6i_expires = jiffies + clock_t_to_jiffies(rtmsg->rtmsg_info); + if (rtmsg->rtmsg_info == 0) + rt->rt6i_expires = 0; + else + rt->rt6i_expires = jiffies + clock_t_to_jiffies(rtmsg->rtmsg_info); if (nlh && (r = NLMSG_DATA(nlh))) { rt->rt6i_protocol = r->rtm_protocol; } else { @@ -954,6 +957,9 @@ rt->rt6i_flags = rtmsg->rtmsg_flags; install_route: + if (rt->rt6i_expires == 0) + rt->rt6i_flags &= ~RTF_EXPIRES; + if (rta && rta[RTA_METRICS-1]) { int attrlen = RTA_PAYLOAD(rta[RTA_METRICS-1]); struct rtattr *attr = RTA_DATA(rta[RTA_METRICS-1]); @@ -1307,7 +1313,7 @@ rtmsg.rtmsg_type = RTMSG_NEWROUTE; ipv6_addr_copy(&rtmsg.rtmsg_gateway, gwaddr); rtmsg.rtmsg_metric = 1024; - rtmsg.rtmsg_flags = RTF_GATEWAY | RTF_ADDRCONF | RTF_DEFAULT | RTF_UP | RTF_EXPIRES; + rtmsg.rtmsg_flags = RTF_GATEWAY | RTF_ADDRCONF | RTF_DEFAULT | RTF_UP; rtmsg.rtmsg_ifindex = dev->ifindex;
Re: IPv6: to take care of permanent routes
When adding a route, expiration attribute may be 0. In my understanding, it means the route never expires and rt6i_expires should be 0, and not the current time. If right, attached patch should fix the issue. Well, please drop RTF_EXPIRES also. Thanks. Following patch drops this flag. As you can see, it requires to set the flag back to RTF_EXPIRES in ndisc_router_discovery(), because rt6_add_dflt_router() asks a new route with RTF_EXPIRES flag set and rtmsg_info = 0. The issue is ndisc_router_discovery() sets itself rt6i_expires itself with the router lifetime found in RA. A better fix could be to pass the lifetime in nb HZ to rt6_add_dflt_router(), what do you think ? Regards, Jean-Mickael Signed-off-by: [EMAIL PROTECTED] --- route.c.origWed Jan 25 16:12:52 2006 +++ route.c Thu Jan 26 15:49:23 2006 @@ -948,7 +948,10 @@ } rt->u.dst.obsolete = -1; - rt->rt6i_expires = jiffies + clock_t_to_jiffies(rtmsg->rtmsg_info); + if (rtmsg->rtmsg_info == 0) + rt->rt6i_expires = 0; + else + rt->rt6i_expires = jiffies + clock_t_to_jiffies(rtmsg->rtmsg_info); if (nlh && (r = NLMSG_DATA(nlh))) { rt->rt6i_protocol = r->rtm_protocol; } else { @@ -1070,6 +1073,9 @@ rt->rt6i_flags = rtmsg->rtmsg_flags; install_route: + if (rt->rt6i_expires == 0) + rt->rt6i_flags &= ~RTF_EXPIRES; + if (rta && rta[RTA_METRICS-1]) { int attrlen = RTA_PAYLOAD(rta[RTA_METRICS-1]); struct rtattr *attr = RTA_DATA(rta[RTA_METRICS-1]); --- ndisc.c.origThu Jan 26 16:29:03 2006 +++ ndisc.c Thu Jan 26 16:29:40 2006 @@ -1151,8 +1151,10 @@ neigh->flags |= NTF_ROUTER; } - if (rt) + if (rt) { rt->rt6i_expires = jiffies + (HZ * lifetime); + rt->rt6i_flags |= RTF_EXPIRES; + } if (ra_msg->icmph.icmp6_hop_limit) { in6_dev->cnf.hop_limit = ra_msg->icmph.icmp6_hop_limit;
IPv6: to take care of permanent routes
Hi, When adding a route, expiration attribute may be 0. In my understanding, it means the route never expires and rt6i_expires should be 0, and not the current time. If right, attached patch should fix the issue. Regards, Jean-Mickael Signed-off-by: [EMAIL PROTECTED] --- route.c.origWed Jan 25 16:12:52 2006 +++ route.c Wed Jan 25 16:13:49 2006 @@ -948,7 +948,10 @@ } rt->u.dst.obsolete = -1; - rt->rt6i_expires = jiffies + clock_t_to_jiffies(rtmsg->rtmsg_info); + if (rtmsg->rtmsg_info == 0) + rt->rt6i_expires = 0; + else + rt->rt6i_expires = jiffies + clock_t_to_jiffies(rtmsg->rtmsg_info); if (nlh && (r = NLMSG_DATA(nlh))) { rt->rt6i_protocol = r->rtm_protocol; } else {
Re: [PATCH] RP filter support for IPv6, kernel 2.6.15 (fwd)
+static int rt6_validate_source( struct sk_buff *skb) { + struct rt6_info *rt; + rt=rt6_lookup(&skb->nh.ipv6h->saddr,NULL,0,0); + if ( rt!=NULL ) { + if (rt->rt6i_idev->dev == skb->dev ) + return 0; Before comparing incoming interface, one could check rt->dst->error. I think the release of rt->dst is missing too. > + if (ipv6_devconf.rp_filter & idev->cnf.rp_filter ) { > + if (rt6_validate_source(skb)<0) { > + printk(KERN_WARNING "RP_FILTER-- Packet refused from \ > %x:%x:%x:%x:%x:%x:%x:%x to %x:%x:%x:%x:%x:%x:%x:%x from \ > %s\n",NIP6(skb->nh.ipv6h->saddr),NIP6(skb->nh.ipv6h->daddr),skb->dev->name); You should rate limit this message with LIMIT_NETDEBUG macro. Or define a "rp_filter_log" flag in inet6_dev. The name of both interfaces may be useful. Something like "RPF: packet %x:%x:%x:%x:%x:%x:%x:%x received on %s, expected on %s". But it requires to move the log into rt6_validate_source(). Regards, Jean-Mickael - To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html