Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 190225 Details for
Bug 268442
sys-power/acpid-1.0.10: strict aliasing warnings
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
A patch that seems to fix it
alias.patch (text/plain), 2.19 KB, created by
Rafał Mużyło
on 2009-05-03 14:40:50 UTC
(
hide
)
Description:
A patch that seems to fix it
Filename:
MIME Type:
Creator:
Rafał Mużyło
Created:
2009-05-03 14:40:50 UTC
Size:
2.19 KB
patch
obsolete
>--- acpi_ids.c.old 2009-04-29 16:37:13.000000000 +0200 >+++ acpi_ids.c 2009-05-03 16:13:19.000000000 +0200 >@@ -92,12 +92,13 @@ > */ > struct rtattr *tb[CTRL_ATTR_MAX + 1]; > /* pointer to the generic netlink header in the incoming message */ >- struct genlmsghdr *ghdr = NLMSG_DATA(n); >+ struct genlmsghdr ghdr; > /* length of the attribute and payload */ > int len = n->nlmsg_len - NLMSG_LENGTH(GENL_HDRLEN); > /* Pointer to the attribute portion of the message */ > struct rtattr *attrs; > >+ memcpy(&ghdr, NLMSG_DATA(n), sizeof(ghdr)); > if (len < 0) { > fprintf(stderr, "%s: netlink CTRL_CMD_GETFAMILY response, " > "wrong controller message len: %d\n", progname, len); >@@ -111,18 +112,18 @@ > return 0; > } > >- if (ghdr->cmd != CTRL_CMD_GETFAMILY && >- ghdr->cmd != CTRL_CMD_DELFAMILY && >- ghdr->cmd != CTRL_CMD_NEWFAMILY && >- ghdr->cmd != CTRL_CMD_NEWMCAST_GRP && >- ghdr->cmd != CTRL_CMD_DELMCAST_GRP) { >+ if (ghdr.cmd != CTRL_CMD_GETFAMILY && >+ ghdr.cmd != CTRL_CMD_DELFAMILY && >+ ghdr.cmd != CTRL_CMD_NEWFAMILY && >+ ghdr.cmd != CTRL_CMD_NEWMCAST_GRP && >+ ghdr.cmd != CTRL_CMD_DELMCAST_GRP) { > fprintf(stderr, "%s: unknown netlink controller command %d\n", >- progname, ghdr->cmd); >+ progname, ghdr.cmd); > return 0; > } > > /* set attrs to point to the attribute */ >- attrs = (struct rtattr *)((char *)ghdr + GENL_HDRLEN); >+ attrs = (struct rtattr *)((char *)NLMSG_DATA(n) + GENL_HDRLEN); > /* Read the table from the message into "tb". This actually just */ > /* places pointers into the message into tb[]. */ > parse_rtattr(tb, CTRL_ATTR_MAX, attrs, len); >@@ -168,7 +169,7 @@ > /* pointer to the nlmsghdr in req */ > struct nlmsghdr *nlh; > /* pointer to the generic netlink header in req */ >- struct genlmsghdr *ghdr; >+ struct genlmsghdr ghdr; > /* return value */ > int ret = -1; > >@@ -183,9 +184,9 @@ > nlh->nlmsg_type = GENL_ID_CTRL; > > /* set up ghdr to point to the generic netlink header */ >- ghdr = NLMSG_DATA(&req.n); > /* set the command we want to run: "GETFAMILY" */ >- ghdr->cmd = CTRL_CMD_GETFAMILY; >+ ghdr.cmd = CTRL_CMD_GETFAMILY; >+ memcpy(NLMSG_DATA(&req.n), &ghdr, sizeof(ghdr)); > > /* the message payload is the family name */ > addattr_l(nlh, 128, CTRL_ATTR_FAMILY_NAME,
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 268442
: 190225