Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net

Pull networkign fixes from David Miller:
"Networking bug fixes, Cacio e Pepe edition:

1) BNX2X accidently accesses chip rev specific registers without an
appropriate guard, fix from Ariel Elior.

2) When we removed the routing cache, we set ip_rt_max_size to ~0 just
to keep reporting a value to userspace via sysfs. But the ipv4
IPSEC layer was using this to tune itself which is completely bogus
to now do. Fix from Steffen Klassert.

3) Missing initialization in netfilter ipset code from Jozsef
Kadlecsik.

4) Check CTA_TIMEOUT_NAME length properly in netfilter cttimeout code,
fix from Florian Westphal.

5) After removing the routing cache, we inadvertantly are caching
multicast routes that end up looping back locally, we cannot do
that legitimately any more. Fix from Julian Anastasov.

6) Revert a race fix for 8139cp qemu/kvm that doesn't actually work
properly on real hardware. From Francois Romieu.

7) Fixup errors in example command lines in VXLAN device docs."

* git://git.kernel.org/pub/scm/linux/kernel/git/davem/net:
bnx2x: remove redundant warning log
vxlan: fix command usage in its doc
8139cp: revert "set ring address before enabling receiver"
ipv4: do not cache looped multicasts
netfilter: cttimeout: fix buffer overflow
netfilter: ipset: Fix range bug in hash:ip,port,net
xfrm: Fix the gc threshold value for ipv4

+43 -46
+2 -2
Documentation/networking/vxlan.txt
··· 32 32 # ip link delete vxlan0 33 33 34 34 3. Show vxlan info 35 - # ip -d show vxlan0 35 + # ip -d link show vxlan0 36 36 37 37 It is possible to create, destroy and display the vxlan 38 38 forwarding table using the new bridge command. ··· 41 41 # bridge fdb add to 00:17:42:8a:b4:05 dst 192.19.0.2 dev vxlan0 42 42 43 43 2. Delete forwarding table entry 44 - # bridge fdb delete 00:17:42:8a:b4:05 44 + # bridge fdb delete 00:17:42:8a:b4:05 dev vxlan0 45 45 46 46 3. Show forwarding table 47 47 # bridge fdb show dev vxlan0
+7 -4
drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c
··· 9545 9545 */ 9546 9546 static void __devinit bnx2x_prev_interrupted_dmae(struct bnx2x *bp) 9547 9547 { 9548 - u32 val = REG_RD(bp, PGLUE_B_REG_PGLUE_B_INT_STS); 9549 - if (val & PGLUE_B_PGLUE_B_INT_STS_REG_WAS_ERROR_ATTN) { 9550 - BNX2X_ERR("was error bit was found to be set in pglueb upon startup. Clearing"); 9551 - REG_WR(bp, PGLUE_B_REG_WAS_ERROR_PF_7_0_CLR, 1 << BP_FUNC(bp)); 9548 + if (!CHIP_IS_E1x(bp)) { 9549 + u32 val = REG_RD(bp, PGLUE_B_REG_PGLUE_B_INT_STS); 9550 + if (val & PGLUE_B_PGLUE_B_INT_STS_REG_WAS_ERROR_ATTN) { 9551 + BNX2X_ERR("was error bit was found to be set in pglueb upon startup. Clearing"); 9552 + REG_WR(bp, PGLUE_B_REG_WAS_ERROR_PF_7_0_CLR, 9553 + 1 << BP_FUNC(bp)); 9554 + } 9552 9555 } 9553 9556 } 9554 9557
+11 -11
drivers/net/ethernet/realtek/8139cp.c
··· 979 979 cpw32_f (MAC0 + 0, le32_to_cpu (*(__le32 *) (dev->dev_addr + 0))); 980 980 cpw32_f (MAC0 + 4, le32_to_cpu (*(__le32 *) (dev->dev_addr + 4))); 981 981 982 - cpw32_f(HiTxRingAddr, 0); 983 - cpw32_f(HiTxRingAddr + 4, 0); 984 - 985 - ring_dma = cp->ring_dma; 986 - cpw32_f(RxRingAddr, ring_dma & 0xffffffff); 987 - cpw32_f(RxRingAddr + 4, (ring_dma >> 16) >> 16); 988 - 989 - ring_dma += sizeof(struct cp_desc) * CP_RX_RING_SIZE; 990 - cpw32_f(TxRingAddr, ring_dma & 0xffffffff); 991 - cpw32_f(TxRingAddr + 4, (ring_dma >> 16) >> 16); 992 - 993 982 cp_start_hw(cp); 994 983 cpw8(TxThresh, 0x06); /* XXX convert magic num to a constant */ 995 984 ··· 991 1002 cp->wol_enabled = 0; 992 1003 993 1004 cpw8(Config5, cpr8(Config5) & PMEStatus); 1005 + 1006 + cpw32_f(HiTxRingAddr, 0); 1007 + cpw32_f(HiTxRingAddr + 4, 0); 1008 + 1009 + ring_dma = cp->ring_dma; 1010 + cpw32_f(RxRingAddr, ring_dma & 0xffffffff); 1011 + cpw32_f(RxRingAddr + 4, (ring_dma >> 16) >> 16); 1012 + 1013 + ring_dma += sizeof(struct cp_desc) * CP_RX_RING_SIZE; 1014 + cpw32_f(TxRingAddr, ring_dma & 0xffffffff); 1015 + cpw32_f(TxRingAddr + 4, (ring_dma >> 16) >> 16); 994 1016 995 1017 cpw16(MultiIntr, 0); 996 1018
+1 -1
include/net/xfrm.h
··· 1351 1351 }; 1352 1352 1353 1353 extern void xfrm_init(void); 1354 - extern void xfrm4_init(int rt_hash_size); 1354 + extern void xfrm4_init(void); 1355 1355 extern int xfrm_state_init(struct net *net); 1356 1356 extern void xfrm_state_fini(struct net *net); 1357 1357 extern void xfrm4_state_init(void);
+6 -3
net/ipv4/route.c
··· 1785 1785 if (dev_out->flags & IFF_LOOPBACK) 1786 1786 flags |= RTCF_LOCAL; 1787 1787 1788 + do_cache = true; 1788 1789 if (type == RTN_BROADCAST) { 1789 1790 flags |= RTCF_BROADCAST | RTCF_LOCAL; 1790 1791 fi = NULL; ··· 1794 1793 if (!ip_check_mc_rcu(in_dev, fl4->daddr, fl4->saddr, 1795 1794 fl4->flowi4_proto)) 1796 1795 flags &= ~RTCF_LOCAL; 1796 + else 1797 + do_cache = false; 1797 1798 /* If multicast route do not exist use 1798 1799 * default one, but do not gateway in this case. 1799 1800 * Yes, it is hack. ··· 1805 1802 } 1806 1803 1807 1804 fnhe = NULL; 1808 - do_cache = fi != NULL; 1809 - if (fi) { 1805 + do_cache &= fi != NULL; 1806 + if (do_cache) { 1810 1807 struct rtable __rcu **prth; 1811 1808 struct fib_nh *nh = &FIB_RES_NH(*res); 1812 1809 ··· 2600 2597 pr_err("Unable to create route proc files\n"); 2601 2598 #ifdef CONFIG_XFRM 2602 2599 xfrm_init(); 2603 - xfrm4_init(ip_rt_max_size); 2600 + xfrm4_init(); 2604 2601 #endif 2605 2602 rtnl_register(PF_INET, RTM_GETROUTE, inet_rtm_getroute, NULL, NULL); 2606 2603
+1 -12
net/ipv4/xfrm4_policy.c
··· 279 279 xfrm_policy_unregister_afinfo(&xfrm4_policy_afinfo); 280 280 } 281 281 282 - void __init xfrm4_init(int rt_max_size) 282 + void __init xfrm4_init(void) 283 283 { 284 - /* 285 - * Select a default value for the gc_thresh based on the main route 286 - * table hash size. It seems to me the worst case scenario is when 287 - * we have ipsec operating in transport mode, in which we create a 288 - * dst_entry per socket. The xfrm gc algorithm starts trying to remove 289 - * entries at gc_thresh, and prevents new allocations as 2*gc_thresh 290 - * so lets set an initial xfrm gc_thresh value at the rt_max_size/2. 291 - * That will let us store an ipsec connection per route table entry, 292 - * and start cleaning when were 1/2 full 293 - */ 294 - xfrm4_dst_ops.gc_thresh = rt_max_size/2; 295 284 dst_entries_init(&xfrm4_dst_ops); 296 285 297 286 xfrm4_state_init();
+2 -2
net/netfilter/ipset/ip_set_hash_ip.c
··· 173 173 return adtfn(set, &nip, timeout, flags); 174 174 } 175 175 176 + ip_to = ip; 176 177 if (tb[IPSET_ATTR_IP_TO]) { 177 178 ret = ip_set_get_hostipaddr4(tb[IPSET_ATTR_IP_TO], &ip_to); 178 179 if (ret) ··· 186 185 if (!cidr || cidr > 32) 187 186 return -IPSET_ERR_INVALID_CIDR; 188 187 ip_set_mask_from_to(ip, ip_to, cidr); 189 - } else 190 - ip_to = ip; 188 + } 191 189 192 190 hosts = h->netmask == 32 ? 1 : 2 << (32 - h->netmask - 1); 193 191
+3 -4
net/netfilter/ipset/ip_set_hash_ipport.c
··· 162 162 const struct ip_set_hash *h = set->data; 163 163 ipset_adtfn adtfn = set->variant->adt[adt]; 164 164 struct hash_ipport4_elem data = { }; 165 - u32 ip, ip_to = 0, p = 0, port, port_to; 165 + u32 ip, ip_to, p = 0, port, port_to; 166 166 u32 timeout = h->timeout; 167 167 bool with_ports = false; 168 168 int ret; ··· 210 210 return ip_set_eexist(ret, flags) ? 0 : ret; 211 211 } 212 212 213 - ip = ntohl(data.ip); 213 + ip_to = ip = ntohl(data.ip); 214 214 if (tb[IPSET_ATTR_IP_TO]) { 215 215 ret = ip_set_get_hostipaddr4(tb[IPSET_ATTR_IP_TO], &ip_to); 216 216 if (ret) ··· 223 223 if (!cidr || cidr > 32) 224 224 return -IPSET_ERR_INVALID_CIDR; 225 225 ip_set_mask_from_to(ip, ip_to, cidr); 226 - } else 227 - ip_to = ip; 226 + } 228 227 229 228 port_to = port = ntohs(data.port); 230 229 if (with_ports && tb[IPSET_ATTR_PORT_TO]) {
+3 -4
net/netfilter/ipset/ip_set_hash_ipportip.c
··· 166 166 const struct ip_set_hash *h = set->data; 167 167 ipset_adtfn adtfn = set->variant->adt[adt]; 168 168 struct hash_ipportip4_elem data = { }; 169 - u32 ip, ip_to = 0, p = 0, port, port_to; 169 + u32 ip, ip_to, p = 0, port, port_to; 170 170 u32 timeout = h->timeout; 171 171 bool with_ports = false; 172 172 int ret; ··· 218 218 return ip_set_eexist(ret, flags) ? 0 : ret; 219 219 } 220 220 221 - ip = ntohl(data.ip); 221 + ip_to = ip = ntohl(data.ip); 222 222 if (tb[IPSET_ATTR_IP_TO]) { 223 223 ret = ip_set_get_hostipaddr4(tb[IPSET_ATTR_IP_TO], &ip_to); 224 224 if (ret) ··· 231 231 if (!cidr || cidr > 32) 232 232 return -IPSET_ERR_INVALID_CIDR; 233 233 ip_set_mask_from_to(ip, ip_to, cidr); 234 - } else 235 - ip_to = ip; 234 + } 236 235 237 236 port_to = port = ntohs(data.port); 238 237 if (with_ports && tb[IPSET_ATTR_PORT_TO]) {
+5 -2
net/netfilter/ipset/ip_set_hash_ipportnet.c
··· 215 215 const struct ip_set_hash *h = set->data; 216 216 ipset_adtfn adtfn = set->variant->adt[adt]; 217 217 struct hash_ipportnet4_elem data = { .cidr = HOST_MASK - 1 }; 218 - u32 ip, ip_to = 0, p = 0, port, port_to; 219 - u32 ip2_from = 0, ip2_to, ip2_last, ip2; 218 + u32 ip, ip_to, p = 0, port, port_to; 219 + u32 ip2_from, ip2_to, ip2_last, ip2; 220 220 u32 timeout = h->timeout; 221 221 bool with_ports = false; 222 222 u8 cidr; ··· 286 286 return ip_set_eexist(ret, flags) ? 0 : ret; 287 287 } 288 288 289 + ip_to = ip; 289 290 if (tb[IPSET_ATTR_IP_TO]) { 290 291 ret = ip_set_get_hostipaddr4(tb[IPSET_ATTR_IP_TO], &ip_to); 291 292 if (ret) ··· 307 306 if (port > port_to) 308 307 swap(port, port_to); 309 308 } 309 + 310 + ip2_to = ip2_from; 310 311 if (tb[IPSET_ATTR_IP2_TO]) { 311 312 ret = ip_set_get_hostipaddr4(tb[IPSET_ATTR_IP2_TO], &ip2_to); 312 313 if (ret)