diff options
-rw-r--r-- | drivers/net/niu.c | 22 | ||||
-rw-r--r-- | include/net/route.h | 1 | ||||
-rw-r--r-- | include/net/sctp/structs.h | 3 | ||||
-rw-r--r-- | net/8021q/vlan.c | 2 | ||||
-rw-r--r-- | net/bridge/br_fdb.c | 2 | ||||
-rw-r--r-- | net/ipv4/route.c | 5 | ||||
-rw-r--r-- | net/ipv6/ip6_output.c | 2 | ||||
-rw-r--r-- | net/rxrpc/rxkad.c | 1 | ||||
-rw-r--r-- | net/sctp/bind_addr.c | 26 | ||||
-rw-r--r-- | net/sctp/socket.c | 18 |
10 files changed, 64 insertions, 18 deletions
diff --git a/drivers/net/niu.c b/drivers/net/niu.c index 112ab079ce7d..abfc61c3a38c 100644 --- a/drivers/net/niu.c +++ b/drivers/net/niu.c | |||
@@ -1045,6 +1045,7 @@ static int niu_serdes_init(struct niu *np) | |||
1045 | } | 1045 | } |
1046 | 1046 | ||
1047 | static void niu_init_xif(struct niu *); | 1047 | static void niu_init_xif(struct niu *); |
1048 | static void niu_handle_led(struct niu *, int status); | ||
1048 | 1049 | ||
1049 | static int niu_link_status_common(struct niu *np, int link_up) | 1050 | static int niu_link_status_common(struct niu *np, int link_up) |
1050 | { | 1051 | { |
@@ -1066,11 +1067,15 @@ static int niu_link_status_common(struct niu *np, int link_up) | |||
1066 | 1067 | ||
1067 | spin_lock_irqsave(&np->lock, flags); | 1068 | spin_lock_irqsave(&np->lock, flags); |
1068 | niu_init_xif(np); | 1069 | niu_init_xif(np); |
1070 | niu_handle_led(np, 1); | ||
1069 | spin_unlock_irqrestore(&np->lock, flags); | 1071 | spin_unlock_irqrestore(&np->lock, flags); |
1070 | 1072 | ||
1071 | netif_carrier_on(dev); | 1073 | netif_carrier_on(dev); |
1072 | } else if (netif_carrier_ok(dev) && !link_up) { | 1074 | } else if (netif_carrier_ok(dev) && !link_up) { |
1073 | niuwarn(LINK, "%s: Link is down\n", dev->name); | 1075 | niuwarn(LINK, "%s: Link is down\n", dev->name); |
1076 | spin_lock_irqsave(&np->lock, flags); | ||
1077 | niu_handle_led(np, 0); | ||
1078 | spin_unlock_irqrestore(&np->lock, flags); | ||
1074 | netif_carrier_off(dev); | 1079 | netif_carrier_off(dev); |
1075 | } | 1080 | } |
1076 | 1081 | ||
@@ -3915,16 +3920,14 @@ static int niu_init_ipp(struct niu *np) | |||
3915 | return 0; | 3920 | return 0; |
3916 | } | 3921 | } |
3917 | 3922 | ||
3918 | static void niu_init_xif_xmac(struct niu *np) | 3923 | static void niu_handle_led(struct niu *np, int status) |
3919 | { | 3924 | { |
3920 | struct niu_link_config *lp = &np->link_config; | ||
3921 | u64 val; | 3925 | u64 val; |
3922 | |||
3923 | val = nr64_mac(XMAC_CONFIG); | 3926 | val = nr64_mac(XMAC_CONFIG); |
3924 | 3927 | ||
3925 | if ((np->flags & NIU_FLAGS_10G) != 0 && | 3928 | if ((np->flags & NIU_FLAGS_10G) != 0 && |
3926 | (np->flags & NIU_FLAGS_FIBER) != 0) { | 3929 | (np->flags & NIU_FLAGS_FIBER) != 0) { |
3927 | if (netif_carrier_ok(np->dev)) { | 3930 | if (status) { |
3928 | val |= XMAC_CONFIG_LED_POLARITY; | 3931 | val |= XMAC_CONFIG_LED_POLARITY; |
3929 | val &= ~XMAC_CONFIG_FORCE_LED_ON; | 3932 | val &= ~XMAC_CONFIG_FORCE_LED_ON; |
3930 | } else { | 3933 | } else { |
@@ -3933,6 +3936,15 @@ static void niu_init_xif_xmac(struct niu *np) | |||
3933 | } | 3936 | } |
3934 | } | 3937 | } |
3935 | 3938 | ||
3939 | nw64_mac(XMAC_CONFIG, val); | ||
3940 | } | ||
3941 | |||
3942 | static void niu_init_xif_xmac(struct niu *np) | ||
3943 | { | ||
3944 | struct niu_link_config *lp = &np->link_config; | ||
3945 | u64 val; | ||
3946 | |||
3947 | val = nr64_mac(XMAC_CONFIG); | ||
3936 | val &= ~XMAC_CONFIG_SEL_POR_CLK_SRC; | 3948 | val &= ~XMAC_CONFIG_SEL_POR_CLK_SRC; |
3937 | 3949 | ||
3938 | val |= XMAC_CONFIG_TX_OUTPUT_EN; | 3950 | val |= XMAC_CONFIG_TX_OUTPUT_EN; |
@@ -4776,6 +4788,8 @@ static int niu_close(struct net_device *dev) | |||
4776 | 4788 | ||
4777 | niu_free_channels(np); | 4789 | niu_free_channels(np); |
4778 | 4790 | ||
4791 | niu_handle_led(np, 0); | ||
4792 | |||
4779 | return 0; | 4793 | return 0; |
4780 | } | 4794 | } |
4781 | 4795 | ||
diff --git a/include/net/route.h b/include/net/route.h index f7ce6259f86f..59b0b19205a2 100644 --- a/include/net/route.h +++ b/include/net/route.h | |||
@@ -109,7 +109,6 @@ struct in_device; | |||
109 | extern int ip_rt_init(void); | 109 | extern int ip_rt_init(void); |
110 | extern void ip_rt_redirect(__be32 old_gw, __be32 dst, __be32 new_gw, | 110 | extern void ip_rt_redirect(__be32 old_gw, __be32 dst, __be32 new_gw, |
111 | __be32 src, struct net_device *dev); | 111 | __be32 src, struct net_device *dev); |
112 | extern void ip_rt_advice(struct rtable **rp, int advice); | ||
113 | extern void rt_cache_flush(int how); | 112 | extern void rt_cache_flush(int how); |
114 | extern int __ip_route_output_key(struct rtable **, const struct flowi *flp); | 113 | extern int __ip_route_output_key(struct rtable **, const struct flowi *flp); |
115 | extern int ip_route_output_key(struct rtable **, struct flowi *flp); | 114 | extern int ip_route_output_key(struct rtable **, struct flowi *flp); |
diff --git a/include/net/sctp/structs.h b/include/net/sctp/structs.h index eb3113c38a94..002a00a4e6be 100644 --- a/include/net/sctp/structs.h +++ b/include/net/sctp/structs.h | |||
@@ -1184,6 +1184,9 @@ int sctp_bind_addr_copy(struct sctp_bind_addr *dest, | |||
1184 | const struct sctp_bind_addr *src, | 1184 | const struct sctp_bind_addr *src, |
1185 | sctp_scope_t scope, gfp_t gfp, | 1185 | sctp_scope_t scope, gfp_t gfp, |
1186 | int flags); | 1186 | int flags); |
1187 | int sctp_bind_addr_dup(struct sctp_bind_addr *dest, | ||
1188 | const struct sctp_bind_addr *src, | ||
1189 | gfp_t gfp); | ||
1187 | int sctp_add_bind_addr(struct sctp_bind_addr *, union sctp_addr *, | 1190 | int sctp_add_bind_addr(struct sctp_bind_addr *, union sctp_addr *, |
1188 | __u8 use_as_src, gfp_t gfp); | 1191 | __u8 use_as_src, gfp_t gfp); |
1189 | int sctp_del_bind_addr(struct sctp_bind_addr *, union sctp_addr *); | 1192 | int sctp_del_bind_addr(struct sctp_bind_addr *, union sctp_addr *); |
diff --git a/net/8021q/vlan.c b/net/8021q/vlan.c index 6567213959cb..5b183156307a 100644 --- a/net/8021q/vlan.c +++ b/net/8021q/vlan.c | |||
@@ -776,7 +776,7 @@ static int vlan_ioctl_handler(struct net *net, void __user *arg) | |||
776 | case SET_VLAN_NAME_TYPE_CMD: | 776 | case SET_VLAN_NAME_TYPE_CMD: |
777 | err = -EPERM; | 777 | err = -EPERM; |
778 | if (!capable(CAP_NET_ADMIN)) | 778 | if (!capable(CAP_NET_ADMIN)) |
779 | return -EPERM; | 779 | break; |
780 | if ((args.u.name_type >= 0) && | 780 | if ((args.u.name_type >= 0) && |
781 | (args.u.name_type < VLAN_NAME_TYPE_HIGHEST)) { | 781 | (args.u.name_type < VLAN_NAME_TYPE_HIGHEST)) { |
782 | vlan_name_type = args.u.name_type; | 782 | vlan_name_type = args.u.name_type; |
diff --git a/net/bridge/br_fdb.c b/net/bridge/br_fdb.c index eb57502bb264..bc40377136a2 100644 --- a/net/bridge/br_fdb.c +++ b/net/bridge/br_fdb.c | |||
@@ -44,7 +44,7 @@ int __init br_fdb_init(void) | |||
44 | return 0; | 44 | return 0; |
45 | } | 45 | } |
46 | 46 | ||
47 | void __exit br_fdb_fini(void) | 47 | void br_fdb_fini(void) |
48 | { | 48 | { |
49 | kmem_cache_destroy(br_fdb_cache); | 49 | kmem_cache_destroy(br_fdb_cache); |
50 | } | 50 | } |
diff --git a/net/ipv4/route.c b/net/ipv4/route.c index c426dec6d579..d2bc6148a737 100644 --- a/net/ipv4/route.c +++ b/net/ipv4/route.c | |||
@@ -1161,7 +1161,7 @@ static struct dst_entry *ipv4_negative_advice(struct dst_entry *dst) | |||
1161 | unsigned hash = rt_hash(rt->fl.fl4_dst, rt->fl.fl4_src, | 1161 | unsigned hash = rt_hash(rt->fl.fl4_dst, rt->fl.fl4_src, |
1162 | rt->fl.oif); | 1162 | rt->fl.oif); |
1163 | #if RT_CACHE_DEBUG >= 1 | 1163 | #if RT_CACHE_DEBUG >= 1 |
1164 | printk(KERN_DEBUG "ip_rt_advice: redirect to " | 1164 | printk(KERN_DEBUG "ipv4_negative_advice: redirect to " |
1165 | "%u.%u.%u.%u/%02x dropped\n", | 1165 | "%u.%u.%u.%u/%02x dropped\n", |
1166 | NIPQUAD(rt->rt_dst), rt->fl.fl4_tos); | 1166 | NIPQUAD(rt->rt_dst), rt->fl.fl4_tos); |
1167 | #endif | 1167 | #endif |
@@ -1252,6 +1252,7 @@ static int ip_error(struct sk_buff *skb) | |||
1252 | break; | 1252 | break; |
1253 | case ENETUNREACH: | 1253 | case ENETUNREACH: |
1254 | code = ICMP_NET_UNREACH; | 1254 | code = ICMP_NET_UNREACH; |
1255 | IP_INC_STATS_BH(IPSTATS_MIB_INNOROUTES); | ||
1255 | break; | 1256 | break; |
1256 | case EACCES: | 1257 | case EACCES: |
1257 | code = ICMP_PKT_FILTERED; | 1258 | code = ICMP_PKT_FILTERED; |
@@ -1881,6 +1882,8 @@ no_route: | |||
1881 | RT_CACHE_STAT_INC(in_no_route); | 1882 | RT_CACHE_STAT_INC(in_no_route); |
1882 | spec_dst = inet_select_addr(dev, 0, RT_SCOPE_UNIVERSE); | 1883 | spec_dst = inet_select_addr(dev, 0, RT_SCOPE_UNIVERSE); |
1883 | res.type = RTN_UNREACHABLE; | 1884 | res.type = RTN_UNREACHABLE; |
1885 | if (err == -ESRCH) | ||
1886 | err = -ENETUNREACH; | ||
1884 | goto local_input; | 1887 | goto local_input; |
1885 | 1888 | ||
1886 | /* | 1889 | /* |
diff --git a/net/ipv6/ip6_output.c b/net/ipv6/ip6_output.c index 86e1835ce4e4..6338a9c1aa14 100644 --- a/net/ipv6/ip6_output.c +++ b/net/ipv6/ip6_output.c | |||
@@ -933,6 +933,8 @@ static int ip6_dst_lookup_tail(struct sock *sk, | |||
933 | return 0; | 933 | return 0; |
934 | 934 | ||
935 | out_err_release: | 935 | out_err_release: |
936 | if (err == -ENETUNREACH) | ||
937 | IP6_INC_STATS_BH(NULL, IPSTATS_MIB_OUTNOROUTES); | ||
936 | dst_release(*dst); | 938 | dst_release(*dst); |
937 | *dst = NULL; | 939 | *dst = NULL; |
938 | return err; | 940 | return err; |
diff --git a/net/rxrpc/rxkad.c b/net/rxrpc/rxkad.c index e09a95aa68ff..8e69d6993833 100644 --- a/net/rxrpc/rxkad.c +++ b/net/rxrpc/rxkad.c | |||
@@ -1021,6 +1021,7 @@ static int rxkad_verify_response(struct rxrpc_connection *conn, | |||
1021 | 1021 | ||
1022 | abort_code = RXKADINCONSISTENCY; | 1022 | abort_code = RXKADINCONSISTENCY; |
1023 | if (version != RXKAD_VERSION) | 1023 | if (version != RXKAD_VERSION) |
1024 | goto protocol_error; | ||
1024 | 1025 | ||
1025 | abort_code = RXKADTICKETLEN; | 1026 | abort_code = RXKADTICKETLEN; |
1026 | if (ticket_len < 4 || ticket_len > MAXKRB5TICKETLEN) | 1027 | if (ticket_len < 4 || ticket_len > MAXKRB5TICKETLEN) |
diff --git a/net/sctp/bind_addr.c b/net/sctp/bind_addr.c index cae95af9a8cc..6a7d01091f0c 100644 --- a/net/sctp/bind_addr.c +++ b/net/sctp/bind_addr.c | |||
@@ -105,6 +105,32 @@ out: | |||
105 | return error; | 105 | return error; |
106 | } | 106 | } |
107 | 107 | ||
108 | /* Exactly duplicate the address lists. This is necessary when doing | ||
109 | * peer-offs and accepts. We don't want to put all the current system | ||
110 | * addresses into the endpoint. That's useless. But we do want duplicat | ||
111 | * the list of bound addresses that the older endpoint used. | ||
112 | */ | ||
113 | int sctp_bind_addr_dup(struct sctp_bind_addr *dest, | ||
114 | const struct sctp_bind_addr *src, | ||
115 | gfp_t gfp) | ||
116 | { | ||
117 | struct sctp_sockaddr_entry *addr; | ||
118 | struct list_head *pos; | ||
119 | int error = 0; | ||
120 | |||
121 | /* All addresses share the same port. */ | ||
122 | dest->port = src->port; | ||
123 | |||
124 | list_for_each(pos, &src->address_list) { | ||
125 | addr = list_entry(pos, struct sctp_sockaddr_entry, list); | ||
126 | error = sctp_add_bind_addr(dest, &addr->a, 1, gfp); | ||
127 | if (error < 0) | ||
128 | break; | ||
129 | } | ||
130 | |||
131 | return error; | ||
132 | } | ||
133 | |||
108 | /* Initialize the SCTP_bind_addr structure for either an endpoint or | 134 | /* Initialize the SCTP_bind_addr structure for either an endpoint or |
109 | * an association. | 135 | * an association. |
110 | */ | 136 | */ |
diff --git a/net/sctp/socket.c b/net/sctp/socket.c index ff8bc95670ed..ea9649ca0b2a 100644 --- a/net/sctp/socket.c +++ b/net/sctp/socket.c | |||
@@ -6325,7 +6325,7 @@ static void sctp_sock_migrate(struct sock *oldsk, struct sock *newsk, | |||
6325 | struct sctp_endpoint *newep = newsp->ep; | 6325 | struct sctp_endpoint *newep = newsp->ep; |
6326 | struct sk_buff *skb, *tmp; | 6326 | struct sk_buff *skb, *tmp; |
6327 | struct sctp_ulpevent *event; | 6327 | struct sctp_ulpevent *event; |
6328 | int flags = 0; | 6328 | struct sctp_bind_hashbucket *head; |
6329 | 6329 | ||
6330 | /* Migrate socket buffer sizes and all the socket level options to the | 6330 | /* Migrate socket buffer sizes and all the socket level options to the |
6331 | * new socket. | 6331 | * new socket. |
@@ -6342,23 +6342,21 @@ static void sctp_sock_migrate(struct sock *oldsk, struct sock *newsk, | |||
6342 | newsp->hmac = NULL; | 6342 | newsp->hmac = NULL; |
6343 | 6343 | ||
6344 | /* Hook this new socket in to the bind_hash list. */ | 6344 | /* Hook this new socket in to the bind_hash list. */ |
6345 | head = &sctp_port_hashtable[sctp_phashfn(inet_sk(oldsk)->num)]; | ||
6346 | sctp_local_bh_disable(); | ||
6347 | sctp_spin_lock(&head->lock); | ||
6345 | pp = sctp_sk(oldsk)->bind_hash; | 6348 | pp = sctp_sk(oldsk)->bind_hash; |
6346 | sk_add_bind_node(newsk, &pp->owner); | 6349 | sk_add_bind_node(newsk, &pp->owner); |
6347 | sctp_sk(newsk)->bind_hash = pp; | 6350 | sctp_sk(newsk)->bind_hash = pp; |
6348 | inet_sk(newsk)->num = inet_sk(oldsk)->num; | 6351 | inet_sk(newsk)->num = inet_sk(oldsk)->num; |
6352 | sctp_spin_unlock(&head->lock); | ||
6353 | sctp_local_bh_enable(); | ||
6349 | 6354 | ||
6350 | /* Copy the bind_addr list from the original endpoint to the new | 6355 | /* Copy the bind_addr list from the original endpoint to the new |
6351 | * endpoint so that we can handle restarts properly | 6356 | * endpoint so that we can handle restarts properly |
6352 | */ | 6357 | */ |
6353 | if (PF_INET6 == assoc->base.sk->sk_family) | 6358 | sctp_bind_addr_dup(&newsp->ep->base.bind_addr, |
6354 | flags = SCTP_ADDR6_ALLOWED; | 6359 | &oldsp->ep->base.bind_addr, GFP_KERNEL); |
6355 | if (assoc->peer.ipv4_address) | ||
6356 | flags |= SCTP_ADDR4_PEERSUPP; | ||
6357 | if (assoc->peer.ipv6_address) | ||
6358 | flags |= SCTP_ADDR6_PEERSUPP; | ||
6359 | sctp_bind_addr_copy(&newsp->ep->base.bind_addr, | ||
6360 | &oldsp->ep->base.bind_addr, | ||
6361 | SCTP_SCOPE_GLOBAL, GFP_KERNEL, flags); | ||
6362 | 6360 | ||
6363 | /* Move any messages in the old socket's receive queue that are for the | 6361 | /* Move any messages in the old socket's receive queue that are for the |
6364 | * peeled off association to the new socket's receive queue. | 6362 | * peeled off association to the new socket's receive queue. |