Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # cat kernel-3.7-struct-fix.patch
- diff --git a/drivers/ipoe/ipoe.c b/drivers/ipoe/ipoe.c
- index 98ea7ff..5d0e978 100644
- --- a/drivers/ipoe/ipoe.c
- +++ b/drivers/ipoe/ipoe.c
- @@ -1034,7 +1034,11 @@ static int ipoe_nl_cmd_noop(struct sk_buff *skb, struct genl_info *info)
- goto out;
- }
- +#if LINUX_VERSION_CODE < KERNEL_VERSION(3,7,0)
- hdr = genlmsg_put(msg, info->snd_pid, info->snd_seq,
- +#else
- + hdr = genlmsg_put(msg, info->snd_portid, info->snd_seq,
- +#endif
- &ipoe_nl_family, 0, IPOE_CMD_NOOP);
- if (IS_ERR(hdr)) {
- ret = PTR_ERR(hdr);
- @@ -1043,7 +1047,9 @@ static int ipoe_nl_cmd_noop(struct sk_buff *skb, struct genl_info *info)
- genlmsg_end(msg, hdr);
- -#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,32)
- +#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,7,0)
- + return genlmsg_unicast(genl_info_net(info), msg, info->snd_portid);
- +#elif LINUX_VERSION_CODE < KERNEL_VERSION(2,6,32)
- return genlmsg_unicast(msg, info->snd_pid);
- #else
- return genlmsg_unicast(genl_info_net(info), msg, info->snd_pid);
- @@ -1095,7 +1101,11 @@ static int ipoe_nl_cmd_create(struct sk_buff *skb, struct genl_info *info)
- goto out;
- }
- +#if LINUX_VERSION_CODE < KERNEL_VERSION(3,7,0)
- hdr = genlmsg_put(msg, info->snd_pid, info->snd_seq,
- +#else
- + hdr = genlmsg_put(msg, info->snd_portid, info->snd_seq,
- +#endif
- &ipoe_nl_family, 0, IPOE_CMD_CREATE);
- if (IS_ERR(hdr)) {
- ret = PTR_ERR(hdr);
- @@ -1114,7 +1124,9 @@ static int ipoe_nl_cmd_create(struct sk_buff *skb, struct genl_info *info)
- nla_put_u32(msg, IPOE_ATTR_IFINDEX, ret);
- genlmsg_end(msg, hdr);
- -#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,32)
- +#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,7,0)
- + return genlmsg_unicast(genl_info_net(info), msg, info->snd_portid);
- +#elif LINUX_VERSION_CODE < KERNEL_VERSION(2,6,32)
- return genlmsg_unicast(msg, info->snd_pid);
- #else
- return genlmsg_unicast(genl_info_net(info), msg, info->snd_pid);
- @@ -1334,7 +1346,11 @@ static int ipoe_nl_cmd_dump_sessions(struct sk_buff *skb, struct netlink_callbac
- if (idx++ < start_idx)
- continue;
- +#if LINUX_VERSION_CODE < KERNEL_VERSION(3,7,0)
- if (fill_info(skb, ses, NETLINK_CB(cb->skb).pid, cb->nlh->nlmsg_seq) < 0)
- +#else
- + if (fill_info(skb, ses, NETLINK_CB(cb->skb).portid, cb->nlh->nlmsg_seq) < 0)
- +#endif
- break;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement