Date: Fri, 19 Sep 2008 16:58:26 -0700 From: "Ahrenholz, Jeffrey M" <jeffrey.m.ahrenholz@boeing.com> To: "Julian Elischer" <julian@elischer.org> Cc: antipsychic <antipsychic@gmail.com>, freebsd-virtualization@freebsd.org Subject: RE: natd & vimage Message-ID: <0DF156EE7414494187B087A3C279BDB40A94023E@XCH-NW-6V1.nw.nos.boeing.com> In-Reply-To: <48D43A63.8080808@elischer.org> References: <FDDBDFB6-AE66-436C-B3A3-8D0AF9664186@gmail.com> <0DF156EE7414494187B087A3C279BDB40A93F94B@XCH-NW-6V1.nw.nos.boeing.com> <48D2F9B1.8020507@elischer.org> <0DF156EE7414494187B087A3C279BDB40A94021D@XCH-NW-6V1.nw.nos.boeing.com> <48D43A63.8080808@elischer.org>
next in thread | previous in thread | raw e-mail | index | archive | help
This is a multi-part message in MIME format. ------_=_NextPart_001_01C91AB3.B40A9061 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable > can you send your diffs anyhow? > I never completed the virtualisation of divert. > I'll see what I can do with them. OK, here it is, good luck! I had divert working on a non-SMP system, could divert packets to a userspace program that touches them. Then the mroute part is a little bigger. Currently testing with XORP PIM. Known bug during system reboot it crashes during ip_mroute module unload. Haven't tested IPv6 multicast forwarding yet. (slightly off-topic/wrong list, but you can crash a 7.0-GENERIC kernel if you install the Xorp package from ports and set it up as a rendezvous point!) -Jeff ------_=_NextPart_001_01C91AB3.B40A9061 Content-Type: application/octet-stream; name="mroutedivert-20080908.patch" Content-Transfer-Encoding: base64 Content-Description: mroutedivert-20080908.patch Content-Disposition: attachment; filename="mroutedivert-20080908.patch" ZGlmZiAtdXIgbmV0aW5ldDYvaXA2X2lucHV0LmMub3JpZyBuZXRpbmV0Ni9pcDZfaW5wdXQuYwot LS0gbmV0aW5ldDYvaXA2X2lucHV0LmMub3JpZwkyMDA3LTExLTE5IDA5OjA5OjM5LjAwMDAwMDAw MCAtMDgwMAorKysgbmV0aW5ldDYvaXA2X2lucHV0LmMJ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3V0OworICAgIHJlcS0+aWNvdW50ID0gVl92aWZ0YWJsZVt2aWZpXS52X3BrdF9p bjsKKyAgICByZXEtPm9jb3VudCA9IFZfdmlmdGFibGVbdmlmaV0udl9wa3Rfb3V0OworICAgIHJl cS0+aWJ5dGVzID0gVl92aWZ0YWJsZVt2aWZpXS52X2J5dGVzX2luOworICAgIHJlcS0+b2J5dGVz ID0gVl92aWZ0YWJsZVt2aWZpXS52X2J5dGVzX291dDsKICAgICBWSUZfVU5MT0NLKCk7CiAKICAg ICByZXR1cm4gMDsKQEAgLTYzMiwxNiArNjcyLDI1IEBACiBzdGF0aWMgdm9pZAogaXBfbXJvdXRl cl9yZXNldCh2b2lkKQogewotICAgIGJ6ZXJvKChjYWRkcl90KW1mY3RhYmxlLCBzaXplb2YobWZj dGFibGUpKTsKLSAgICBiemVybygoY2FkZHJfdCluZXhwaXJlLCBzaXplb2YobmV4cGlyZSkpOwot Ci0gICAgcGltX2Fzc2VydCA9IDA7Ci0gICAgbXJ0X2FwaV9jb25maWcgPSAwOwotCisgICAgSU5J VF9WTkVUX0lORVQoY3Vydm5ldCk7CisgICAgYnplcm8oKGNhZGRyX3QpVl9tZmN0YWJsZSwgc2l6 ZW9mKFZfbWZjdGFibGUpKTsKKyAgICBiemVybygoY2FkZHJfdClWX25leHBpcmUsIHNpemVvZihW X25leHBpcmUpKTsKKyAgICBpZiAoVl9yZWdfdmlmX251bSAhPSBWSUZJX0lOVkFMSUQpCisJSUZf QUREUl9MT0NLX0RFU1RST1koJlZfbXVsdGljYXN0X3JlZ2lzdGVyX2lmKTsKKyAgICBiemVybygm Vl9tdWx0aWNhc3RfcmVnaXN0ZXJfaWYsIHNpemVvZihWX211bHRpY2FzdF9yZWdpc3Rlcl9pZikp OworCisgICAgVl9yZWdfdmlmX251bSA9IFZJRklfSU5WQUxJRDsKKyAgICBWX3BpbV9hc3NlcnQg PSAwOworICAgIFZfbXJ0X2FwaV9jb25maWcgPSAwOworCisgICAgVl9id191cGNhbGx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CAtMjA5NiwxMCArMjE4MiwxMSBAQAogc3RhdGlj IGludAogZGVsX2J3X3VwY2FsbChzdHJ1Y3QgYndfdXBjYWxsICpyZXEpCiB7CisgICAgSU5JVF9W TkVUX0lORVQoY3Vydm5ldCk7CiAgICAgc3RydWN0IG1mYyAqbWZjOwogICAgIHN0cnVjdCBid19t ZXRlciAqeDsKIAotICAgIGlmICghKG1ydF9hcGlfY29uZmlnICYgTVJUX01GQ19CV19VUENBTEwp KQorICAgIGlmICghKFZfbXJ0X2FwaV9jb25maWcgJiBNUlRfTUZDX0JXX1VQQ0FMTCkpCiAJcmV0 dXJuIEVPUE5PVFNVUFA7CiAKICAgICBNRkNfTE9DSygpOwpAQCAtMjI1Miw2ICsyMzM5LDcgQEAK IHN0YXRpYyB2b2lkCiBid19tZXRlcl9wcmVwYXJlX3VwY2FsbChzdHJ1Y3QgYndfbWV0ZXIgKngs IHN0cnVjdCB0aW1ldmFsICpub3dwKQogeworICAgIElOSVRfVk5FVF9JTkVUKGN1cnZuZXQpOwog ICAgIHN0cnVjdCB0aW1ldmFsIGRlbHRhOwogICAgIHN0cnVjdCBid191cGNhbGwgKnU7CiAKQEAg LTIyNjYsMTMgKzIzNTQsMTMgQEAKICAgICAvKgogICAgICAqIElmIHRoZXJlIGFyZSB0b28gbWFu eSBwZW5kaW5nIHVwY2FsbHMsIGRlbGl2ZXIgdGhlbSBub3cKICAgICAgKi8KLSAgICBpZiAoYndf dXBjYWxsc19uID49IEJXX1VQQ0FMTFNfTUFYKQorICAgIGlmIChWX2J3X3VwY2FsbHNfbiA+PSBC V19VUENBTExTX01BWCkKIAlid191cGNhbGxzX3NlbmQoKTsKIAogICAgIC8qCiAgICAgICogU2V0 IHRoZSBid191cGNhbGwgZW50cnkKICAgICAgKi8KLSAgICB1ID0gJmJ3X3VwY2FsbHNbYndfdXBj YWxsc19uKytdOworICAgIHUgPSAmVl9id191cGNhbGxzW1ZfYndfdXBjYWxsc19uKytdOwogICAg IHUtPmJ1X3N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3pvbmUpOworCQlJTlBfSU5GT19XVU5M T0NLKCZWX2RpdmNiaW5mbyk7CisJCUlOUF9JTkZPX0xPQ0tfREVTVFJPWSgmVl9kaXZjYmluZm8p OworCQl1bWFfemRlc3Ryb3koZGl2Y2J6b25lKTsKIAkJYnJlYWs7CiAJZGVmYXVsdDoKIAkJZXJy ID0gRU9QTk9UU1VQUDsK ------_=_NextPart_001_01C91AB3.B40A9061--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?0DF156EE7414494187B087A3C279BDB40A94023E>