Advertisement
Guest User

Untitled

a guest
May 23rd, 2013
97
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 2.56 KB | None | 0 0
  1. # cat kernel-3.7-struct-fix.patch
  2. diff --git a/drivers/ipoe/ipoe.c b/drivers/ipoe/ipoe.c
  3. index 98ea7ff..5d0e978 100644
  4. --- a/drivers/ipoe/ipoe.c
  5. +++ b/drivers/ipoe/ipoe.c
  6. @@ -1034,7 +1034,11 @@ static int ipoe_nl_cmd_noop(struct sk_buff *skb, struct genl_info *info)
  7.                 goto out;
  8.         }
  9.  
  10. +#if LINUX_VERSION_CODE < KERNEL_VERSION(3,7,0)
  11.         hdr = genlmsg_put(msg, info->snd_pid, info->snd_seq,
  12. +#else
  13. +       hdr = genlmsg_put(msg, info->snd_portid, info->snd_seq,
  14. +#endif
  15.                           &ipoe_nl_family, 0, IPOE_CMD_NOOP);
  16.         if (IS_ERR(hdr)) {
  17.                 ret = PTR_ERR(hdr);
  18. @@ -1043,7 +1047,9 @@ static int ipoe_nl_cmd_noop(struct sk_buff *skb, struct genl_info *info)
  19.  
  20.         genlmsg_end(msg, hdr);
  21.  
  22. -#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,32)
  23. +#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,7,0)
  24. +       return genlmsg_unicast(genl_info_net(info), msg, info->snd_portid);
  25. +#elif LINUX_VERSION_CODE < KERNEL_VERSION(2,6,32)
  26.         return genlmsg_unicast(msg, info->snd_pid);
  27.  #else
  28.         return genlmsg_unicast(genl_info_net(info), msg, info->snd_pid);
  29. @@ -1095,7 +1101,11 @@ static int ipoe_nl_cmd_create(struct sk_buff *skb, struct genl_info *info)
  30.                 goto out;
  31.         }
  32.  
  33. +#if LINUX_VERSION_CODE < KERNEL_VERSION(3,7,0)
  34.         hdr = genlmsg_put(msg, info->snd_pid, info->snd_seq,
  35. +#else
  36. +       hdr = genlmsg_put(msg, info->snd_portid, info->snd_seq,
  37. +#endif
  38.                           &ipoe_nl_family, 0, IPOE_CMD_CREATE);
  39.         if (IS_ERR(hdr)) {
  40.                 ret = PTR_ERR(hdr);
  41. @@ -1114,7 +1124,9 @@ static int ipoe_nl_cmd_create(struct sk_buff *skb, struct genl_info *info)
  42.         nla_put_u32(msg, IPOE_ATTR_IFINDEX, ret);
  43.  
  44.         genlmsg_end(msg, hdr);
  45. -#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,32)
  46. +#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,7,0)
  47. +       return genlmsg_unicast(genl_info_net(info), msg, info->snd_portid);
  48. +#elif LINUX_VERSION_CODE < KERNEL_VERSION(2,6,32)
  49.         return genlmsg_unicast(msg, info->snd_pid);
  50.  #else
  51.         return genlmsg_unicast(genl_info_net(info), msg, info->snd_pid);
  52. @@ -1334,7 +1346,11 @@ static int ipoe_nl_cmd_dump_sessions(struct sk_buff *skb, struct netlink_callbac
  53.                 if (idx++ < start_idx)
  54.                         continue;
  55.  
  56. +#if LINUX_VERSION_CODE < KERNEL_VERSION(3,7,0)
  57.                 if (fill_info(skb, ses, NETLINK_CB(cb->skb).pid, cb->nlh->nlmsg_seq) < 0)
  58. +#else
  59. +               if (fill_info(skb, ses, NETLINK_CB(cb->skb).portid, cb->nlh->nlmsg_seq) < 0)
  60. +#endif
  61.                         break;
  62.         }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement