Skip to contentSkip to conversation

e1000: fix build on Ubuntu with _FORTIFY_SOURCE

PATCH Applied Thomas Monjalon 2 participants 2 messages Mar 31, 2010 – Apr 8, 2010

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 e1000: fix build on Ubuntu with _FORTIFY_SOURCE

From: Thomas Monjalon <[email protected]>

There was a pointer cast warning on Ubuntu since _FORTIFY_SOURCE has been reenabled.

_FORTIFY_SOURCE had been disabled by 4a24470497360d8b77568b83008d0e9d6eb0787d and reenabled by 849583050d5f6f782718be8cb50688978973fbea.

---
 hw/e1000.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
hw/e1000.c +1 -1
index fd3059a..34cc451 100644
@@ -642,7 +642,7 @@ e1000_receive(VLANClientState *nc, const uint8_t *buf, size_t size)
 
     if (vlan_enabled(s) && is_vlan_packet(s, buf)) {
         vlan_special = cpu_to_le16(be16_to_cpup((uint16_t *)(buf + 14)));
-        memmove((void *)(buf + 4), buf, 12);
+        memmove((uint8_t *)buf + 4, buf, 12);
         vlan_status = E1000_RXD_STAT_VP;
         vlan_offset = 4;
         size -= 4;
Signature · 1 line
1.7.0.3
#1 lore raw
Quoted 8 lines · Thomas Monjalon

From: Thomas Monjalon <[email protected]>

There was a pointer cast warning on Ubuntu since _FORTIFY_SOURCE has been reenabled.

_FORTIFY_SOURCE had been disabled by 4a24470497360d8b77568b83008d0e9d6eb0787d and reenabled by 849583050d5f6f782718be8cb50688978973fbea.

Thanks, applied.

Quoted 25 lines
---
 hw/e1000.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
hw/e1000.c +1 -1
index fd3059a..34cc451 100644
@@ -642,7 +642,7 @@ e1000_receive(VLANClientState *nc, const uint8_t *buf, size_t size)
 
     if (vlan_enabled(s) && is_vlan_packet(s, buf)) {
         vlan_special = cpu_to_le16(be16_to_cpup((uint16_t *)(buf + 14)));
-        memmove((void *)(buf + 4), buf, 12);
+        memmove((uint8_t *)buf + 4, buf, 12);
         vlan_status = E1000_RXD_STAT_VP;
         vlan_offset = 4;
         size -= 4;
Signature · 1 line
1.7.0.3
Signature · 2 lines
Aurelien Jarno                          GPG: 1024D/F1BCDB73
[email protected]                 http://www.aurel32.net