datapath/linux/compat/ip6_gre.c
/*
 *	And now the modules code and kernel interface.
 */
And now the modules code and kernel interface.
And now the modules code and kernel interface .
int rpl_ip6gre_init(void)
{
	int err;
	err = register_pernet_device(&ip6gre_net_ops);
	if (err < 0) {
		if (err == -EEXIST)
			goto ip6_gre_loaded;
		else
			goto out;
	}
	err = inet6_add_protocol(&ip6gre_protocol, IPPROTO_GRE);
	if (err < 0) {
		pr_info("%s: can't add protocol\n", __func__);
		unregister_pernet_device(&ip6gre_net_ops);
		err = -EEXIST;
		goto ip6_gre_loaded;
	}
	pr_info("GRE over IPv6 tunneling driver\n");
	ovs_vport_ops_register(&ovs_ip6gre_vport_ops);
	ovs_vport_ops_register(&ovs_erspan6_vport_ops);
	return err;
ip6_gre_loaded:
	pr_info("GRE TX only over IPv6 tunneling driver\n");
	ip6_gre_loaded = true;
	ovs_vport_ops_register(&ovs_ip6gre_vport_ops);
	ovs_vport_ops_register(&ovs_erspan6_vport_ops);
out:
	return err;
}
int rpl_ip6gre_init ( void ) { int err ; err = register_pernet_device ( & ip6gre_net_ops ) ; if ( err < 0 ) { if ( err == - EEXIST ) goto ip6_gre_loaded ; else goto out ; } err = inet6_add_protocol ( & ip6gre_protocol , IPPROTO_GRE ) ; if ( err < 0 ) { pr_info ( " \n " , __func__ ) ; unregister_pernet_device ( & ip6gre_net_ops ) ; err = - EEXIST ; goto ip6_gre_loaded ; } pr_info ( " \n " ) ; ovs_vport_ops_register ( & ovs_ip6gre_vport_ops ) ; ovs_vport_ops_register ( & ovs_erspan6_vport_ops ) ; return err ; ip6_gre_loaded : pr_info ( " \n " ) ; ip6_gre_loaded = true ; ovs_vport_ops_register ( & ovs_ip6gre_vport_ops ) ; ovs_vport_ops_register ( & ovs_erspan6_vport_ops ) ; out : return err ; }
And now the modules code and kernel interface.
And now the modules code and kernel interface .
/*
		 * inet6_add_protocol will return a -1 if it fails
		 * to grab the pointer but the vport initialization
		 * expects a return value of -EEXIST.  Set err to
		 * -EEXIST here to ensure proper handling.
		 */ /* Since IPv6 GRE only allows single receiver to be registerd,
	 * we skip here so only transmit works, see:
	 *
	 * commit f9242b6b28d61295f2bf7e8adfb1060b382e5381
	 * Author: David S. Miller <davem@davemloft.net>
	 * Date:   Tue Jun 19 18:56:21 2012 -0700
	 *
	 *     inet: Sanitize inet{,6} protocol demux.
	 *
	 * OVS GRE receive part is disabled.
	 */