[PATCH 1/7] net: handle addr_type of 0 properly

Subsystems: networking [general], the rest

STALE5647d

14 messages, 2 authors, 2011-02-25 · open the first message on its own page

[PATCH 1/7] net: handle addr_type of 0 properly

From: Hagen Paul Pfeifer <hidden>
Date: 2011-02-25 15:53:25

addr_type of 0 means that the type should be adopted from from_dev and
not from __hw_addr_del_multiple(). Unfortunately it isn't so and
addr_type will always be considered. Fix this by implementing the
considered and documented behavior.

Signed-off-by: Hagen Paul Pfeifer <redacted>
---
 net/core/dev_addr_lists.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/net/core/dev_addr_lists.c b/net/core/dev_addr_lists.c
index 508f9c1..133fd22 100644
--- a/net/core/dev_addr_lists.c
+++ b/net/core/dev_addr_lists.c
@@ -144,7 +144,7 @@ void __hw_addr_del_multiple(struct netdev_hw_addr_list *to_list,
 
 	list_for_each_entry(ha, &from_list->list, list) {
 		type = addr_type ? addr_type : ha->type;
-		__hw_addr_del(to_list, ha->addr, addr_len, addr_type);
+		__hw_addr_del(to_list, ha->addr, addr_len, type);
 	}
 }
 EXPORT_SYMBOL(__hw_addr_del_multiple);
-- 
1.7.2.3

[PATCH 5/7] ipv6: variable next is never used in this function

From: Hagen Paul Pfeifer <hidden>
Date: 2011-02-25 15:53:25

Signed-off-by: Hagen Paul Pfeifer <redacted>
---
 net/ipv6/route.c |    4 +---
 1 files changed, 1 insertions(+), 3 deletions(-)
diff --git a/net/ipv6/route.c b/net/ipv6/route.c
index f786aed..7e9443f 100644
--- a/net/ipv6/route.c
+++ b/net/ipv6/route.c
@@ -1075,11 +1075,9 @@ out:
 
 int icmp6_dst_gc(void)
 {
-	struct dst_entry *dst, *next, **pprev;
+	struct dst_entry *dst, **pprev;
 	int more = 0;
 
-	next = NULL;
-
 	spin_lock_bh(&icmp6_dst_lock);
 	pprev = &icmp6_dst_gc_list;
 
-- 
1.7.2.3

[PATCH 2/7] dccp: newdp is declared/assigned but never be used

From: Hagen Paul Pfeifer <hidden>
Date: 2011-02-25 15:53:25

Declaration and assignment of newdp is removed. Usage of dccp_sk()
exhibit no side effects.

Signed-off-by: Hagen Paul Pfeifer <redacted>
---
 net/dccp/ipv6.c |    3 ---
 1 files changed, 0 insertions(+), 3 deletions(-)
diff --git a/net/dccp/ipv6.c b/net/dccp/ipv6.c
index dca711d..460d545 100644
--- a/net/dccp/ipv6.c
+++ b/net/dccp/ipv6.c
@@ -484,7 +484,6 @@ static struct sock *dccp_v6_request_recv_sock(struct sock *sk,
 	struct inet6_request_sock *ireq6 = inet6_rsk(req);
 	struct ipv6_pinfo *newnp, *np = inet6_sk(sk);
 	struct inet_sock *newinet;
-	struct dccp_sock *newdp;
 	struct dccp6_sock *newdp6;
 	struct sock *newsk;
 	struct ipv6_txoptions *opt;
@@ -498,7 +497,6 @@ static struct sock *dccp_v6_request_recv_sock(struct sock *sk,
 			return NULL;
 
 		newdp6 = (struct dccp6_sock *)newsk;
-		newdp = dccp_sk(newsk);
 		newinet = inet_sk(newsk);
 		newinet->pinet6 = &newdp6->inet6;
 		newnp = inet6_sk(newsk);
@@ -578,7 +576,6 @@ static struct sock *dccp_v6_request_recv_sock(struct sock *sk,
 	newdp6 = (struct dccp6_sock *)newsk;
 	newinet = inet_sk(newsk);
 	newinet->pinet6 = &newdp6->inet6;
-	newdp = dccp_sk(newsk);
 	newnp = inet6_sk(newsk);
 
 	memcpy(newnp, np, sizeof(struct ipv6_pinfo));
-- 
1.7.2.3

[PATCH 6/7] ipv6: ignore rtnl_unicast() return code

From: Hagen Paul Pfeifer <hidden>
Date: 2011-02-25 15:53:25

rtnl_unicast() return value is not of interest, we can silently ignore
it, save some instructions and four byte on the stack.

Signed-off-by: Hagen Paul Pfeifer <redacted>
---
 net/ipv6/ip6mr.c |    3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)
diff --git a/net/ipv6/ip6mr.c b/net/ipv6/ip6mr.c
index 0e1d53b..618f67cc 100644
--- a/net/ipv6/ip6mr.c
+++ b/net/ipv6/ip6mr.c
@@ -1039,7 +1039,6 @@ static void ip6mr_cache_resolve(struct net *net, struct mr6_table *mrt,
 
 	while((skb = __skb_dequeue(&uc->mfc_un.unres.unresolved))) {
 		if (ipv6_hdr(skb)->version == 0) {
-			int err;
 			struct nlmsghdr *nlh = (struct nlmsghdr *)skb_pull(skb, sizeof(struct ipv6hdr));
 
 			if (__ip6mr_fill_mroute(mrt, skb, c, NLMSG_DATA(nlh)) > 0) {
@@ -1050,7 +1049,7 @@ static void ip6mr_cache_resolve(struct net *net, struct mr6_table *mrt,
 				skb_trim(skb, nlh->nlmsg_len);
 				((struct nlmsgerr *)NLMSG_DATA(nlh))->error = -EMSGSIZE;
 			}
-			err = rtnl_unicast(skb, net, NETLINK_CB(skb).pid);
+			rtnl_unicast(skb, net, NETLINK_CB(skb).pid);
 		} else
 			ip6_mr_forward(net, mrt, skb, c);
 	}
-- 
1.7.2.3

[PATCH 3/7] ipv6: totlen is declared and assigned but not used

From: Hagen Paul Pfeifer <hidden>
Date: 2011-02-25 15:53:25

Signed-off-by: Hagen Paul Pfeifer <redacted>
---
 net/ipv6/ip6_output.c |    3 ---
 1 files changed, 0 insertions(+), 3 deletions(-)
diff --git a/net/ipv6/ip6_output.c b/net/ipv6/ip6_output.c
index 2600e22..25a2647 100644
--- a/net/ipv6/ip6_output.c
+++ b/net/ipv6/ip6_output.c
@@ -274,13 +274,10 @@ int ip6_nd_hdr(struct sock *sk, struct sk_buff *skb, struct net_device *dev,
 {
 	struct ipv6_pinfo *np = inet6_sk(sk);
 	struct ipv6hdr *hdr;
-	int totlen;
 
 	skb->protocol = htons(ETH_P_IPV6);
 	skb->dev = dev;
 
-	totlen = len + sizeof(struct ipv6hdr);
-
 	skb_reset_network_header(skb);
 	skb_put(skb, sizeof(struct ipv6hdr));
 	hdr = ipv6_hdr(skb);
-- 
1.7.2.3

[PATCH 7/7] sched: protocol only needed when CONFIG_NET_CLS_ACT is enabled

From: Hagen Paul Pfeifer <hidden>
Date: 2011-02-25 15:53:26

Signed-off-by: Hagen Paul Pfeifer <redacted>
---
 net/sched/sch_api.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/net/sched/sch_api.c b/net/sched/sch_api.c
index 1507415..7490f3f 100644
--- a/net/sched/sch_api.c
+++ b/net/sched/sch_api.c
@@ -1672,12 +1672,12 @@ int tc_classify(struct sk_buff *skb, struct tcf_proto *tp,
 		struct tcf_result *res)
 {
 	int err = 0;
-	__be16 protocol;
 #ifdef CONFIG_NET_CLS_ACT
+	__be16 protocol;
 	struct tcf_proto *otp = tp;
 reclassify:
-#endif
 	protocol = skb->protocol;
+#endif
 
 	err = tc_classify_compat(skb, tp, res);
 #ifdef CONFIG_NET_CLS_ACT
-- 
1.7.2.3

[PATCH 4/7] ipv6: hash is calculated but not used afterwards

From: Hagen Paul Pfeifer <hidden>
Date: 2011-02-25 15:53:26

hash is declared and assigned but not used anymore. ipv6_addr_hash()
exhibit no side-effects.

Signed-off-by: Hagen Paul Pfeifer <redacted>
---
 net/ipv6/addrconf.c |    3 ---
 1 files changed, 0 insertions(+), 3 deletions(-)
diff --git a/net/ipv6/addrconf.c b/net/ipv6/addrconf.c
index fd6782e..3daaf3c 100644
--- a/net/ipv6/addrconf.c
+++ b/net/ipv6/addrconf.c
@@ -718,12 +718,9 @@ static void ipv6_del_addr(struct inet6_ifaddr *ifp)
 	struct inet6_ifaddr *ifa, *ifn;
 	struct inet6_dev *idev = ifp->idev;
 	int state;
-	int hash;
 	int deleted = 0, onlink = 0;
 	unsigned long expires = jiffies;
 
-	hash = ipv6_addr_hash(&ifp->addr);
-
 	spin_lock_bh(&ifp->state_lock);
 	state = ifp->state;
 	ifp->state = INET6_IFADDR_STATE_DEAD;
-- 
1.7.2.3

Re: [PATCH 1/7] net: handle addr_type of 0 properly

From: David Miller <davem@davemloft.net>
Date: 2011-02-25 21:58:29

From: Hagen Paul Pfeifer <redacted>
Date: Fri, 25 Feb 2011 16:45:15 +0100
addr_type of 0 means that the type should be adopted from from_dev and
not from __hw_addr_del_multiple(). Unfortunately it isn't so and
addr_type will always be considered. Fix this by implementing the
considered and documented behavior.

Signed-off-by: Hagen Paul Pfeifer <redacted>
Applied to net-2.6, thanks.

Re: [PATCH 2/7] dccp: newdp is declared/assigned but never be used

From: David Miller <davem@davemloft.net>
Date: 2011-02-25 22:00:03

From: Hagen Paul Pfeifer <redacted>
Date: Fri, 25 Feb 2011 16:45:16 +0100
Declaration and assignment of newdp is removed. Usage of dccp_sk()
exhibit no side effects.

Signed-off-by: Hagen Paul Pfeifer <redacted>
Applied to net-next-2.6

Re: [PATCH 3/7] ipv6: totlen is declared and assigned but not used

From: David Miller <davem@davemloft.net>
Date: 2011-02-25 22:00:09

From: Hagen Paul Pfeifer <redacted>
Date: Fri, 25 Feb 2011 16:45:17 +0100
Signed-off-by: Hagen Paul Pfeifer <redacted>
Applied to net-next-2.6

Re: [PATCH 4/7] ipv6: hash is calculated but not used afterwards

From: David Miller <davem@davemloft.net>
Date: 2011-02-25 22:00:16

From: Hagen Paul Pfeifer <redacted>
Date: Fri, 25 Feb 2011 16:45:18 +0100
hash is declared and assigned but not used anymore. ipv6_addr_hash()
exhibit no side-effects.

Signed-off-by: Hagen Paul Pfeifer <redacted>
Applied to net-next-2.6

Re: [PATCH 5/7] ipv6: variable next is never used in this function

From: David Miller <davem@davemloft.net>
Date: 2011-02-25 22:00:24

From: Hagen Paul Pfeifer <redacted>
Date: Fri, 25 Feb 2011 16:45:19 +0100
Signed-off-by: Hagen Paul Pfeifer <redacted>
Applied to net-next-2.6

Re: [PATCH 6/7] ipv6: ignore rtnl_unicast() return code

From: David Miller <davem@davemloft.net>
Date: 2011-02-25 22:00:31

From: Hagen Paul Pfeifer <redacted>
Date: Fri, 25 Feb 2011 16:45:20 +0100
rtnl_unicast() return value is not of interest, we can silently ignore
it, save some instructions and four byte on the stack.

Signed-off-by: Hagen Paul Pfeifer <redacted>
Applied to net-next-2.6

Re: [PATCH 7/7] sched: protocol only needed when CONFIG_NET_CLS_ACT is enabled

From: David Miller <davem@davemloft.net>
Date: 2011-02-25 22:00:39

From: Hagen Paul Pfeifer <redacted>
Date: Fri, 25 Feb 2011 16:45:21 +0100
Signed-off-by: Hagen Paul Pfeifer <redacted>
Applied to net-next-2.6
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help