* [PATCH] net/core: use htons for skb->protocol
@ 2010-06-29 16:32 Sebastian Andrzej Siewior
2010-06-29 22:17 ` David Miller
2010-06-29 22:19 ` [PATCH] net/core: use htons " David Daney
0 siblings, 2 replies; 5+ messages in thread
From: Sebastian Andrzej Siewior @ 2010-06-29 16:32 UTC (permalink / raw)
To: netdev
From: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
This is only noticed by people that are not doing everything correct in
the first place.
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
---
net/core/dev.c | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/net/core/dev.c b/net/core/dev.c
index 2b3bf53..78ad37c 100644
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -1541,7 +1541,8 @@ static void dev_queue_xmit_nit(struct sk_buff *skb, struct net_device *dev)
if (net_ratelimit())
printk(KERN_CRIT "protocol %04x is "
"buggy, dev %s\n",
- skb2->protocol, dev->name);
+ htons(skb2->protocol),
+ dev->name);
skb_reset_network_header(skb2);
}
--
1.7.0.4
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH] net/core: use htons for skb->protocol
2010-06-29 16:32 [PATCH] net/core: use htons for skb->protocol Sebastian Andrzej Siewior
@ 2010-06-29 22:17 ` David Miller
2010-06-30 9:02 ` [PATCH v2] net/core: use ntohs " Sebastian Andrzej Siewior
2010-06-29 22:19 ` [PATCH] net/core: use htons " David Daney
1 sibling, 1 reply; 5+ messages in thread
From: David Miller @ 2010-06-29 22:17 UTC (permalink / raw)
To: sebastian; +Cc: netdev
From: Sebastian Andrzej Siewior <sebastian@breakpoint.cc>
Date: Tue, 29 Jun 2010 18:32:46 +0200
> From: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
>
> This is only noticed by people that are not doing everything correct in
> the first place.
>
> Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
It's in network byte order so you should use ntohs().
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] net/core: use htons for skb->protocol
2010-06-29 16:32 [PATCH] net/core: use htons for skb->protocol Sebastian Andrzej Siewior
2010-06-29 22:17 ` David Miller
@ 2010-06-29 22:19 ` David Daney
1 sibling, 0 replies; 5+ messages in thread
From: David Daney @ 2010-06-29 22:19 UTC (permalink / raw)
To: Sebastian Andrzej Siewior; +Cc: netdev
On 06/29/2010 09:32 AM, Sebastian Andrzej Siewior wrote:
> From: Sebastian Andrzej Siewior<bigeasy@linutronix.de>
>
> This is only noticed by people that are not doing everything correct in
> the first place.
>
> Signed-off-by: Sebastian Andrzej Siewior<bigeasy@linutronix.de>
> ---
> net/core/dev.c | 3 ++-
> 1 files changed, 2 insertions(+), 1 deletions(-)
>
> diff --git a/net/core/dev.c b/net/core/dev.c
> index 2b3bf53..78ad37c 100644
> --- a/net/core/dev.c
> +++ b/net/core/dev.c
> @@ -1541,7 +1541,8 @@ static void dev_queue_xmit_nit(struct sk_buff *skb, struct net_device *dev)
> if (net_ratelimit())
> printk(KERN_CRIT "protocol %04x is "
> "buggy, dev %s\n",
> - skb2->protocol, dev->name);
> + htons(skb2->protocol),
Would ntohs() be more appropriate here? It looks like you are
converting from network order to host order for printing.
David Daney
^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH v2] net/core: use ntohs for skb->protocol
2010-06-29 22:17 ` David Miller
@ 2010-06-30 9:02 ` Sebastian Andrzej Siewior
2010-06-30 17:39 ` David Miller
0 siblings, 1 reply; 5+ messages in thread
From: Sebastian Andrzej Siewior @ 2010-06-30 9:02 UTC (permalink / raw)
To: David Miller; +Cc: netdev
From: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
This is only noticed by people that are not doing everything correct in
the first place.
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
---
net/core/dev.c | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/net/core/dev.c b/net/core/dev.c
index eb4be99..8e61dc5 100644
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -1537,7 +1537,8 @@ static void dev_queue_xmit_nit(struct sk_buff *skb, struct net_device *dev)
if (net_ratelimit())
printk(KERN_CRIT "protocol %04x is "
"buggy, dev %s\n",
- skb2->protocol, dev->name);
+ ntohs(skb2->protocol),
+ dev->name);
skb_reset_network_header(skb2);
}
--
1.6.6.1
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH v2] net/core: use ntohs for skb->protocol
2010-06-30 9:02 ` [PATCH v2] net/core: use ntohs " Sebastian Andrzej Siewior
@ 2010-06-30 17:39 ` David Miller
0 siblings, 0 replies; 5+ messages in thread
From: David Miller @ 2010-06-30 17:39 UTC (permalink / raw)
To: sebastian; +Cc: netdev
From: Sebastian Andrzej Siewior <sebastian@breakpoint.cc>
Date: Wed, 30 Jun 2010 11:02:29 +0200
> From: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
>
> This is only noticed by people that are not doing everything correct in
> the first place.
>
> Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Applied to net-next-2.6, thanks.
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2010-06-30 17:39 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-06-29 16:32 [PATCH] net/core: use htons for skb->protocol Sebastian Andrzej Siewior
2010-06-29 22:17 ` David Miller
2010-06-30 9:02 ` [PATCH v2] net/core: use ntohs " Sebastian Andrzej Siewior
2010-06-30 17:39 ` David Miller
2010-06-29 22:19 ` [PATCH] net/core: use htons " David Daney
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).