exthdrs_offload.c 936 B

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. /*
  2. * IPV6 GSO/GRO offload support
  3. * Linux INET6 implementation
  4. *
  5. * This program is free software; you can redistribute it and/or
  6. * modify it under the terms of the GNU General Public License
  7. * as published by the Free Software Foundation; either version
  8. * 2 of the License, or (at your option) any later version.
  9. *
  10. * IPV6 Extension Header GSO/GRO support
  11. */
  12. #include <net/protocol.h>
  13. #include "ip6_offload.h"
  14. static const struct net_offload rthdr_offload = {
  15. .flags = INET6_PROTO_GSO_EXTHDR,
  16. };
  17. static const struct net_offload dstopt_offload = {
  18. .flags = INET6_PROTO_GSO_EXTHDR,
  19. };
  20. int __init ipv6_exthdrs_offload_init(void)
  21. {
  22. int ret;
  23. ret = inet6_add_offload(&rthdr_offload, IPPROTO_ROUTING);
  24. if (ret)
  25. goto out;
  26. ret = inet6_add_offload(&dstopt_offload, IPPROTO_DSTOPTS);
  27. if (ret)
  28. goto out_rt;
  29. out:
  30. return ret;
  31. out_rt:
  32. inet6_del_offload(&rthdr_offload, IPPROTO_ROUTING);
  33. goto out;
  34. }