mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Russell King <rmk@arm.linux.org.uk>
To: David Miller <davem@redhat.com>
Cc: <linux-kernel@vger.kernel.org>
Subject: [PATCH] 2: 2.5.29-ether
Date: Sat, 03 Aug 2002 19:16:15 +0100	[thread overview]
Message-ID: <E17b3Rn-0006wB-00@flint.arm.linux.org.uk> (raw)

This patch has been verified to apply cleanly to 2.5.30

Some compilers may add extra padding at the end of struct ethhdr.
This patch ensures that sizeof(struct ethhdr) always packed, and
returns the expected size of 14 bytes.

This is particularly important when struct ethhdr is embedded into
a structure, thusly:

struct arc_eth_encap
{
    uint8_t proto;              /* Always ARC_P_ETHER                   */
    struct ethhdr eth;          /* standard ethernet header (yuck!)     */
    uint8_t payload[0];         /* 493 bytes                            */
};
#define ETH_ENCAP_HDR_SIZE 14

or this:

                char *the_ip = (((char *)skb->data))
                                + sizeof(struct ethhdr)
                                + sizeof(struct arphdr) +
                                ETH_ALEN;


 include/linux/if_ether.h |    2 +-
 1 files changed, 1 insertion, 1 deletion

diff -urN orig/include/linux/if_ether.h linux/include/linux/if_ether.h
--- orig/include/linux/if_ether.h	Mon Mar 11 11:56:23 2002
+++ linux/include/linux/if_ether.h	Mon Mar 11 11:45:30 2002
@@ -96,6 +96,6 @@
 	unsigned char	h_dest[ETH_ALEN];	/* destination eth addr	*/
 	unsigned char	h_source[ETH_ALEN];	/* source ether addr	*/
 	unsigned short	h_proto;		/* packet type ID field	*/
-};
+} __attribute__((packed));
 
 #endif	/* _LINUX_IF_ETHER_H */


             reply	other threads:[~2002-08-03 18:12 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-08-03 18:16 Russell King [this message]
2002-08-04  0:10 ` David S. Miller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=E17b3Rn-0006wB-00@flint.arm.linux.org.uk \
    --to=rmk@arm.linux.org.uk \
    --cc=davem@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®