tcpdump mpls pseudowire support

2016-07-07 Thread Rafael Zalamena
This diff teaches tcpdump to recognize MPLS pseudowires with control words only. This should not be a problem since the control words are used by default unless configured otherwise (ldpd does this). It also makes possible to print encapsulated ethernet packets with the new ethernet print function

switchd(8): more debug messages

2016-09-23 Thread Rafael Zalamena
Enable more debug messages to help developing the flow modification messages. ok? Index: ofp13.c === RCS file: /home/obsdcvs/src/usr.sbin/switchd/ofp13.c,v retrieving revision 1.5 diff -u -p -r1.5 ofp13.c --- ofp13.c 21 Jul 2016

switchd(8): fix memory leak and loop

2016-09-23 Thread Rafael Zalamena
This diff fixes a memory leak in ofp_read() that happens in every message and a infinite loop that happens when the remote switch closes the connection. ok? Index: ofp.c === RCS file: /home/obsdcvs/src/usr.sbin/switchd/ofp.c,v retrie

switchd(8): set the pktbuf for packet_in messages

2016-09-23 Thread Rafael Zalamena
The pkt_buf variable is never set in incoming packet_in messages and this diff fixes it. ok? Index: packet.c === RCS file: /home/obsdcvs/src/usr.sbin/switchd/packet.c,v retrieving revision 1.3 diff -u -p -r1.3 packet.c --- packet.c

snmpd(8): fix compilation warnings with DEBUG

2016-09-26 Thread Rafael Zalamena
This diff fixes two compiler warnings when compiling with DEBUG define. ok? Index: timer.c === RCS file: /home/obsdcvs/src/usr.sbin/snmpd/timer.c,v retrieving revision 1.5 diff -u -p -r1.5 timer.c --- timer.c 27 Aug 2016 01:50:0

snmpd(8): teach how to fork+exec

2016-09-26 Thread Rafael Zalamena
Lets teach snmpd(8) how to fork+exec using the proc.c file from the latest switchd(8) diff. Note 1: I just tested the basic operations: startup and teardown. Note 2: the kill with close will be implemented in another diff with the ps_pid removal. ok? Index: proc.c ==

switch(4): don't panic when destroying interfaces

2016-09-26 Thread Rafael Zalamena
switch(4) is currently not handling device removal when the interface is being destroyed. Example: # ifconfig switch0 up # ifconfig vether0 up # ifconfig switch0 add vether0 # ifconfig vether0 destroy # kernel panic here This diff fixes it by calling the switch port detach on the right time. ok?

netstart+switch(4): delay interface start

2016-09-27 Thread Rafael Zalamena
switch(4) needs to have its interface start up delayed, otherwise the netstart script will fail to configure switch(4) with virtual interfaces like vether(4). This diff adds switch(4) to the delayed list just like bridge(4). ok? Index: netstart ===

ntpd(8): use stack instead of heap

2016-10-01 Thread Rafael Zalamena
The ntpd(8) constraint fork+exec diff changed the way the constraint processes are created, but then it introduced new calloc()s to avoid increasing diff size and to focus on the problem. Now that the fork+exec is in, this diff make those variables to become a part of the stack. No functional chan

Re: syslogd fork+exec

2016-10-01 Thread Rafael Zalamena
On Thu, Sep 29, 2016 at 08:09:23PM +0200, Alexander Bluhm wrote: > Hi, > > With this diff syslogd(8) does an exec on itself in the privileged > parent process to reshuffle its memory layout. > > As syslogd only forks once, it does not really matter wether we > fork+exec in the child or in the par

switch(4): use hook to notify interface detach

2016-10-02 Thread Rafael Zalamena
mpi@ suggested that it would be possible to use if_detachhooks to handle the interface teardown instead of adding code to if.c, so this diff does exactly that. Not only we get to remove switch(4) code from if.c, we also get less lines of code by removing some duplicated teardown procedure in switc

bridge(4): use hook to notify interface detach

2016-10-02 Thread Rafael Zalamena
Just like the switch(4) diff, this one does the same thing for the bridge(4). This diff removes bridge(4) code from if.c and uses the detach hook to be notified about interface removals. ok? Index: net/if.c === RCS file: /home/obsd

ntpd(8): use safer dup3() instead of dup2()

2016-10-02 Thread Rafael Zalamena
This diff is an improvement and an attempt to fix the bug where the ntpd(8) not always stays running. During the review of syslogd fork+exec diff I noticed the use of dup3() and went to read its man page: dup2() doesn't always remove the CLOEXEC flag from the descriptor, so using dup3() is a bette

Re: ntpd(8): use safer dup3() instead of dup2()

2016-10-02 Thread Rafael Zalamena
On Sun, Oct 02, 2016 at 02:30:11PM -0700, Philip Guenther wrote: > On Sun, 2 Oct 2016, Rafael Zalamena wrote: > > This diff is an improvement and an attempt to fix the bug where the > > ntpd(8) not always stays running. > > > > During the review of syslogd fork+exe

bridge(4): fix span interface removal

2016-10-03 Thread Rafael Zalamena
While doing the "notify bridge of interface removal with hook" I noticed that the span ports suffer from not having something to remove them. To reproduce this problem, do the following steps: # ifconfig vether0 up # ifconfig bridge0 up # ifconfig bridge0 addspan vether0 # ifconfig vether0 destroy

httpd(8)/proc.c: use less fds on startup

2016-10-04 Thread Rafael Zalamena
This diff makes proc.c daemons to use less file descriptors on startup, this way we increase the number of child we can have considerably. This also improves the solution on a bug reported in bugs@ "httpd errors out with 'too many open files'". To achieve that I delayed the socket distribution an

Re: httpd(8)/proc.c: use less fds on startup

2016-10-04 Thread Rafael Zalamena
On Tue, Oct 04, 2016 at 07:46:52PM +0200, Rafael Zalamena wrote: > This diff makes proc.c daemons to use less file descriptors on startup, > this way we increase the number of child we can have considerably. This > also improves the solution on a bug reported in bugs@ > "httpd err

httpd(8): dup2() fix for proc.c

2016-10-05 Thread Rafael Zalamena
This diff fixes the same problem ntpd(8) had with the dup2() when oldd == newd. Quick background: when you dup2(oldd, newd) and oldd == newd the CLOEXEC flag won't be removed by the descriptor. We could use dup3() to detect this, but it is easier/faster just to compare the fds and do the fcntl() o

switch(4): check for the right mbuf header len

2016-10-08 Thread Rafael Zalamena
This diffs corrects the check for the header length size: instead of looking for MINCLSIZE (which is the cluster mbuf space size) we should use MHLEN (the header mbuf space size). ok? Index: net/switchofp.c === RCS file: /home/obsdc

Re: httpd(8)/proc.c: use less fds on startup

2016-10-10 Thread Rafael Zalamena
On Mon, Oct 10, 2016 at 12:32:49PM +0200, Reyk Floeter wrote: > On Tue, Oct 04, 2016 at 11:54:37PM +0200, Rafael Zalamena wrote: > > On Tue, Oct 04, 2016 at 07:46:52PM +0200, Rafael Zalamena wrote: > > > This diff makes proc.c daemons to use less file descriptors on startup,

relayd(8): proc.c sync and remove fd limit change

2016-10-10 Thread Rafael Zalamena
This diff brings the relayd(8) proc.c up-to-date and removes the file limit alteration in relayd.c. The file limit alteration is not needed anymore since now the number of descriptors pre-allocated is very small (only one descriptor per child + 2 to distribute fds between child). It would be nice

Re: vmd/vmctl load/reload/reset

2016-10-12 Thread Rafael Zalamena
On Wed, Oct 12, 2016 at 02:06:35PM +0200, Reyk Floeter wrote: > On Wed, Oct 12, 2016 at 01:44:25PM +0200, Reyk Floeter wrote: > > Hi, > > > > vmctl reload is currently broken, the attached diff fixes it and > > re-introduces the semantics that originally came from iked: > > > > - load/reload just

switchd(8): implement the setconfig message

2016-10-12 Thread Rafael Zalamena
This diff teaches switchd(8) how to send the set_config message for OpenFlow 1.3.5. We need this to set the default miss_send_len to a value greater than zero so we can receive packets from the switch(4) with the payload. ok? Index: ofp13.c ===

switchd(8): add flow_mod validation

2016-10-12 Thread Rafael Zalamena
This diff teaches switchd(8) how to validate flow_mod messages, more specifically the flow instructions and actions. The oxm validations were already implemented so we get them for free here. ok? Index: sys/net/ofp.h === RCS file: /c

switch(4): fix packet_out message handling

2016-10-14 Thread Rafael Zalamena
The switch(4) packet_out handler wasn't handling some cases, so here is the missing code. 1) pout_buffer_id is a 4 bytes field and it was using the wrong define to check for absence of buffers; 2) When a buffer_id was sent the code didn't handle this, now when this happens we send an error m

switch(4): kill unused function

2016-10-14 Thread Rafael Zalamena
The switch(4) device has a function called switch_forward_flooder() which doesn't seem to be used anywhere. In switchofp.c we have the swofp_action_output() which would be the place where it would be likely called, however it already has the code that does it. Since it doesn't seem to fit anywher

Re: relayd(8): proc.c sync and remove fd limit change

2016-10-14 Thread Rafael Zalamena
On Tue, Oct 11, 2016 at 02:02:46AM +0200, Rafael Zalamena wrote: > This diff brings the relayd(8) proc.c up-to-date and removes the file limit > alteration in relayd.c. The file limit alteration is not needed anymore > since now the number of descriptors pre-allocated is very small

Re: snmpd(8): teach how to fork+exec

2016-10-14 Thread Rafael Zalamena
On Mon, Sep 26, 2016 at 03:45:59PM +0200, Rafael Zalamena wrote: > Lets teach snmpd(8) how to fork+exec using the proc.c file from the latest > switchd(8) diff. > > Note 1: I just tested the basic operations: startup and teardown. > Note 2: the kill with close will be implemented

ifconfig(8): fix set switch(4) datapath id

2016-10-17 Thread Rafael Zalamena
There are two inconsistencies with the ifconfig(8) switch(4) configuring: 1) Datapath ID is an unsigned 64 bit integer, not a signed one; 2) ifconfig(8) man pages says that the parameter is "datapath" not "datapathid"; This diff fixes both problems and let us configure the datapath id correctly

Re: ifconfig(8): fix set switch(4) datapath id

2016-10-17 Thread Rafael Zalamena
On Mon, Oct 17, 2016 at 02:30:41PM +0400, Reyk Floeter wrote: > > > Am 17.10.2016 um 14:16 schrieb Rafael Zalamena : > > > > There are two inconsistencies with the ifconfig(8) switch(4) configuring: > > 1) Datapath ID is an unsigned 64 bit integer, not a signed one;

tcpdump(8): teach how to read ofp

2016-10-19 Thread Rafael Zalamena
bgp_print(bp, length); + else if (sport == OLD_OFP_PORT || dport == OLD_OFP_PORT || + sport == OFP_PORT || dport == OFP_PORT) + ofp_print(bp, length); #if 0 else if (sport == NETBIOS_SSN_PORT || dport == NETBIOS

Re: snmpd(8): teach how to fork+exec

2016-10-21 Thread Rafael Zalamena
On Fri, Oct 14, 2016 at 06:47:09PM +0200, Rafael Zalamena wrote: > On Mon, Sep 26, 2016 at 03:45:59PM +0200, Rafael Zalamena wrote: > > Lets teach snmpd(8) how to fork+exec using the proc.c file from the latest > > switchd(8) diff. > > > > Note 1: I just tested the ba

Re: snmpd(8): teach how to fork+exec

2016-10-21 Thread Rafael Zalamena
On Fri, Oct 21, 2016 at 01:26:36PM +0200, Jeremie Courreges-Anglas wrote: > Rafael Zalamena writes: > > On Fri, Oct 14, 2016 at 06:47:09PM +0200, Rafael Zalamena wrote: > >> On Mon, Sep 26, 2016 at 03:45:59PM +0200, Rafael Zalamena wrote: > >> ---snip--- > > >

Re: tcpdump(8): teach how to read ofp

2016-10-21 Thread Rafael Zalamena
On Wed, Oct 19, 2016 at 12:28:13PM +0200, Rafael Zalamena wrote: > This is the first step to teach tcpdump(8) how to read OpenFlow protocol > packets. I've implemented support for most messages switchd(8) uses and > currently only for OpenFlow 1.3.5, but we might reuse some

Re: snmpd(8): teach how to fork+exec

2016-10-22 Thread Rafael Zalamena
On Sat, Oct 22, 2016 at 08:14:16PM +0200, Jeremie Courreges-Anglas wrote: > Rafael Zalamena writes: > > > On Fri, Oct 21, 2016 at 01:26:36PM +0200, Jeremie Courreges-Anglas wrote: > >> Rafael Zalamena writes: > >> > On Fri, Oct 14, 2016 at 06:47:09PM +0200, Rafa

snmpd(8): turn snmpd_env the only global

2016-10-23 Thread Rafael Zalamena
This diff removes all "extern struct snmpd *" lines from source files, replaces all 'env' occurences with 'snmpd_env' and adds the extern declaration for snmpd_env in the snmpd.h header. With this diff we only need to guarantee that this variable is set, we avoid shadowing other 'env' variables an

tun(4)/tap(4): fix mbuf header space check

2016-10-24 Thread Rafael Zalamena
tun(4)/tap(4) function tun_dev_write() is checking for the wrong size for the mbuf packet header. We must check against MHLEN (the mbuf header data storage size) and not MINCLSIZE (smallest amount of data of a cluster). For the curious: MGETHDR() calls m_gethdr() which uses mbpool to get the mbuf

Re: switchd(8): add flow_mod validation

2016-10-24 Thread Rafael Zalamena
On Wed, Oct 12, 2016 at 05:39:17PM +0200, Rafael Zalamena wrote: > This diff teaches switchd(8) how to validate flow_mod messages, more > specifically the flow instructions and actions. The oxm validations > were already implemented so we get them for free here. I've updated the fl

Re: snmpd(8): teach how to fork+exec

2016-10-28 Thread Rafael Zalamena
On Sat, Oct 22, 2016 at 10:32:27PM +0200, Rafael Zalamena wrote: > On Sat, Oct 22, 2016 at 08:14:16PM +0200, Jeremie Courreges-Anglas wrote: > > Rafael Zalamena writes: > > > On Fri, Oct 21, 2016 at 01:26:36PM +0200, Jeremie Courreges-Anglas wrote: > > >> Rafael Za

switch(4): add more input validations

2016-10-28 Thread Rafael Zalamena
This diff teaches switch(4) how to do more validations on dynamic input field types, like: ofp_match (has N oxms), ofp_action_header (might be followed by N actions) and ofp_instruction (might have N actions inside). This is important because the internal switch structures reuse the ofp_match and

switch(4): input validation: swofp_flow_entry_put_instructions

2016-10-31 Thread Rafael Zalamena
This diff is a part of the bigger diff to add more input validations to the switch(4) OpenFlow protocol parser. In this diff we reworked the swofp_flow_entry_put_instructions() function with the following changes: - Avoid leaking memory on repeated instructions. It is not possible to use the sam

Re: switch(4): add more input validations

2016-10-31 Thread Rafael Zalamena
On Fri, Oct 28, 2016 at 07:56:12PM +0400, Reyk Floeter wrote: > > On 28.10.2016, at 19:20, Rafael Zalamena wrote: > > This diff teaches switch(4) how to do more validations on dynamic input > > field types, like: ofp_match (has N oxms), ofp_action_header (might be > > fo

Re: switchd(8): add flow_mod validation

2016-10-31 Thread Rafael Zalamena
On Mon, Oct 24, 2016 at 07:05:08PM +0200, Rafael Zalamena wrote: > On Wed, Oct 12, 2016 at 05:39:17PM +0200, Rafael Zalamena wrote: > > This diff teaches switchd(8) how to validate flow_mod messages, more > > specifically the flow instructions and actions. The oxm validations &

switchd(8): add more packet-out validations

2016-11-07 Thread Rafael Zalamena
Now that we have the flow-mod validation with the action/instructions support we can extend the usage of this functions for the packet-out validation. This diff increases the packet-out validation coverage by also doing instructions and packet truncation checks. ok? Index: ofp13.c ==

switchd(8): more oxm basic checks

2016-11-17 Thread Rafael Zalamena
This diff adds the missing IP_PROTO oxm validation and adds more hasmask checks for types that should not have that. ok? Index: ofp13.c === RCS file: /cvs/src/usr.sbin/switchd/ofp13.c,v retrieving revision 1.29 diff -u -p -r1.29 ofp1

switchd(8): negotiate versions with hello

2016-11-22 Thread Rafael Zalamena
Teach switchd(8) how to negotiate protocol version using the hello bitmap header. This way switchd(8) is able to fallback or use higher version using the bitmap. This diff also prevents connections from switching version in the middle of the operation. This is the first step before adding a state

Re: vio(4): fixup crash on up/down

2016-11-23 Thread Rafael Zalamena
On Wed, Nov 23, 2016 at 09:03:46AM +0100, Stefan Fritsch wrote: > On Wed, 23 Nov 2016, Mike Belopuhov wrote: > > > I guess we could do that. But then we cannot free the mbufs on DOWN > > > until the device has used them. > > > > Diff to this effect is below. Works on vmd and qemu (original > > on

Re: vio(4): fixup crash on up/down

2016-11-24 Thread Rafael Zalamena
On Wed, Nov 23, 2016 at 09:10:44PM +0100, Stefan Fritsch wrote: > On Wed, 23 Nov 2016, Rafael Zalamena wrote: > > > > Maybe something like this is enough already (untested): > > > > I tried your diff without Mike's if_vio diff and it doesn't panic

switchd(8): learn remote switch tables

2016-12-02 Thread Rafael Zalamena
Learn remote switch's flow table properties so we can use this information to decide where to install the default table-miss flow for OpenFlow 1.3. This is not needed by OpenFlow 1.0 since it already does this by default. This diff implements the functions to ask the remote switch for tables infor

Re: ntpd(8): use stack instead of heap

2016-12-02 Thread Rafael Zalamena
On Sat, Oct 01, 2016 at 07:05:51PM +0200, Rafael Zalamena wrote: > The ntpd(8) constraint fork+exec diff changed the way the constraint > processes are created, but then it introduced new calloc()s to avoid > increasing diff size and to focus on the problem. Now that the fork+exec >

dhcrelay(8): clean up function prototypes

2016-12-07 Thread Rafael Zalamena
I'm implementing some features for dhcrelay and to make them fit I need some clean ups in the dhcrelay(8) first. This diff changes most of the input/output functions prototypes to take one parameter with all addresses instead of passing multiple parameters. Basically this will make input functions

Re: dhcrelay(8): clean up function prototypes

2016-12-07 Thread Rafael Zalamena
On Wed, Dec 07, 2016 at 02:49:55PM +0100, Rafael Zalamena wrote: > ---snipped--- > Actually the code below is not wrong, there are some scenarios where you need this to make relayed DHCP to work. I'm not touching the part I noted before. The diff that I sent before still stands and

Re: dhcrelay: pledge(2)

2016-12-07 Thread Rafael Zalamena
On Wed, Dec 07, 2016 at 02:47:25PM +0100, Reyk Floeter wrote: > Hi, > > dhcrelay drops privs but isn't pledged yet - here it is. > > It is simpler than dhclient: it only needs stdio and route because it > pre-opens all file descriptors (UDP, bpf), does the bpf ioctls before, > and only needs "rou

dhcrelay(8): simplify get_interface()

2016-12-07 Thread Rafael Zalamena
This diff simplifies the get_interface function and makes it more straightforward, it also makes dhcrelay(8) throw a more informative error message when running layer 3 mode (default) on interfaces without an address. I'll use this code later to be able to get_interfaces() without an IP address.

Re: dhcrelay(8): simplify get_interface()

2016-12-07 Thread Rafael Zalamena
On Wed, Dec 07, 2016 at 05:34:05PM +0100, Rafael Zalamena wrote: > This diff simplifies the get_interface function and makes it more > straightforward, it also makes dhcrelay(8) throw a more informative error > message when running layer 3 mode (default) on interfaces without an

Re: dhcrelay(8): clean up function prototypes

2016-12-08 Thread Rafael Zalamena
On Wed, Dec 07, 2016 at 09:36:24PM +0100, Jeremie Courreges-Anglas wrote: > Rafael Zalamena writes: > > > I'm implementing some features for dhcrelay and to make them fit I need > > some clean ups in the dhcrelay(8) first. This diff changes most of the > > input/o

Re: dhcrelay(8): clean up function prototypes

2016-12-08 Thread Rafael Zalamena
On Thu, Dec 08, 2016 at 05:07:41PM +0100, Jeremie Courreges-Anglas wrote: > ---sniped--- > I think you've summoned Cthulhu with this diff. :) > > I started noticing a wrong behavior with when testing a multi-relay > setup, as prompted by Patrick's diff. See > > marc.info/?l=openbsd-tech&m=14809

Re: dhcrelay(8): clean up function prototypes

2016-12-08 Thread Rafael Zalamena
On Thu, Dec 08, 2016 at 06:59:18PM +0100, Jeremie Courreges-Anglas wrote: > Rafael Zalamena writes: > > [...] > > >> Another problem: the relay->server code uses send(2) on a connected > >> socket and thus has no destination IP issue. But the relay->client p

dhcrelay(8): add support for layer 2 relaying

2016-12-08 Thread Rafael Zalamena
This diff implements layer 2 relaying support for dhcrelay with further support for Relay Agent Info (RFC 3046). This feature is mostly used by switched networks that might not be using IP addresses when in the edge with the customer. Basically this diff allows you to run dhcrelay on interfaces wi

dhcrelay(8): filter BOOTREPLY packets

2016-12-08 Thread Rafael Zalamena
This diff makes dhcrelay(8) drop packets that were not meant for us. This is a safety check suggested by jca@ to avoid relaying packets with the address of other relays. ok? Index: dhcrelay.c === RCS file: /cvs/src/usr.sbin/dhcrelay/

Re: dhcrelay(8): add support for layer 2 relaying

2016-12-09 Thread Rafael Zalamena
On Thu, Dec 08, 2016 at 08:43:20PM +0100, Rafael Zalamena wrote: > This diff implements layer 2 relaying support for dhcrelay with further > support for Relay Agent Info (RFC 3046). This feature is mostly used by > switched networks that might not be using IP addresses when in the edge &

Re: dhcrelay(8): add support for layer 2 relaying

2016-12-10 Thread Rafael Zalamena
On Fri, Dec 09, 2016 at 11:55:17PM +0100, Reyk Floeter wrote: > On Fri, Dec 09, 2016 at 10:08:09AM +0100, Rafael Zalamena wrote: > > On Thu, Dec 08, 2016 at 08:43:20PM +0100, Rafael Zalamena wrote: > > > This diff implements layer 2 relaying support for dhcrelay with further

multicast: propagate rdomain for add_vif

2016-12-12 Thread Rafael Zalamena
After trying to run igmpproxy daemon in different rdomains I noted that it fails with the following message: " ERRO: MRT_ADD_VIF; Errno(49): Can't assign requested address " In the following line: " if ( setsockopt( MRouterFD, IPPROTO_IP, MRT_ADD_VIF, (char *)&VifCtl, size

dhcrelay(8): fix default layer 3 remote-id

2016-12-13 Thread Rafael Zalamena
After the many iterations of the layer 2 diff, I noticed I broke the layer 3 default Relay Agent Information insertion: the relayed packet is using the wrong address in the remote-id field. This diff makes the Relay Agent Information init function to run later and get the right address for the def

dhcrelay(8): allow multiple interfaces on l2

2016-12-13 Thread Rafael Zalamena
This diff implements support for allowing dhcrelay(8) to run on multiple source interfaces with just one instance when using layer 2. This is useful if you want to run dhcrelay(8) on multiple interfaces and want to use the same circuit-id/remote-id (e.g. have multiple vlan(4)s on the same interface

igmp: set rtableid on new mbufs

2016-12-14 Thread Rafael Zalamena
After running the igmpproxy in multiple domains I noticed that the kernel started complaining about sending packets on wrong domains. Here is the exact message: " vio1: trying to send packet on wrong domain. if 1 vs. mbuf 0 " After some debugging I traced the problem to the igmp_sendpkt() function

dhcrelay(8): support replacing Relay Agent Info

2016-12-15 Thread Rafael Zalamena
This diff adds dhcrelay support for replacing Relay Agent Information on incoming packets with our configuration. This might be useful if you want to override user sent information or to adapt the incoming packet to another network. ok? Index: dhcrelay.8 ==

Re: igmp: set rtableid on new mbufs

2016-12-16 Thread Rafael Zalamena
On Wed, Dec 14, 2016 at 06:59:42PM +0100, Martin Pieuchot wrote: > On 14/12/16(Wed) 16:54, Rafael Zalamena wrote: > > After running the igmpproxy in multiple domains I noticed that the kernel > > started complaining about sending packets on wrong domains. Here is the &g

Re: mpe(4), mpw(4) and splsoftnet()

2016-12-20 Thread Rafael Zalamena
On Mon, Dec 19, 2016 at 11:48:31AM +0100, Martin Pieuchot wrote: > Interface ioctl(2) are now always run at IPL_SOFTNET, so let's get rid > of recursive splsoftnet()/splx() dances. > > ok? ok rzalamena@

tcpdump mpls pseudowire support

2015-07-17 Thread Rafael Zalamena
This diff adds support for detection of pseudowires inside of MPLS tagged packets. Basically it teaches MPLS to look for ethernet headers when there is no sign of IP headers. Index: interface.h === RCS file: /cvs/src/usr.sbin/tcpdump/

indent ifconfig(8) bridge rules output

2015-07-17 Thread Rafael Zalamena
This diff indents the output of bridge rules in ifconfig or ifconfig bridgeX. Old output: $ ifconfig bridge0 bridge0: flags=41 groups: bridge priority 32768 hellotime 2 fwddelay 15 maxage 20 holdcnt 6 proto rstp designated: id 00:00:00:00:00:00 priority 0 tun1 flags

Re: Fwd: worm.c removing unused variables

2015-08-20 Thread Rafael Zalamena
On Mon, Aug 17, 2015 at 01:00:26PM -0300, Vinicios Barros wrote: > Hello all, > > I would like to suggest these changes to remove unused variables > and a respectively unnecessary call of the gettimeofday, also removes > a casting in the malloc, that seems to be unnecessary. > I improved your di

worm(6) remove cheating bug

2015-08-23 Thread Rafael Zalamena
I just fixed a bug which allowed people to cheat in worm(6). This bug was found out by deraadt@ when peer reviewing the mail thread in tech@ 'Fwd: worm.c removing unused variables'. To reproduce the bug simply hold spacebar and your worm won't move. Highlights: * Use the unused time variables to

Re: worm(6) remove cheating bug

2015-08-23 Thread Rafael Zalamena
On Sun, Aug 23, 2015 at 06:07:46PM -0300, Rafael Zalamena wrote: > I just fixed a bug which allowed people to cheat in worm(6). This bug was > found out by deraadt@ when peer reviewing the mail thread in tech@ > 'Fwd: worm.c removing unused variables'. > > To repr

make robots(6) use ppoll() and timespec

2015-08-24 Thread Rafael Zalamena
Following the worm(6) bug fix and improvement, make robots(6) do it as well. Changes: * Replace timeval with timespec structs; * Use clock_gettime(CLOCK_UPTIME) instead of gettimeofday(); * Use timespec*() instead of manual math operations; * Use ppoll() instead of poll() + math operations; N

Re: tcpdump mpls pseudowire support

2015-09-26 Thread Rafael Zalamena
On Fri, Jul 17, 2015 at 03:24:17PM -0300, Rafael Zalamena wrote: > This diff adds support for detection of pseudowires inside of MPLS tagged > packets. Basically it teaches MPLS to look for ethernet headers when there > is no sign of IP headers. > > --- SNIPPED OLD DIFF --- Thi

daily(8) scratch and junk files removal

2014-07-01 Thread Rafael Zalamena
I noticed a problem in one of my OpenBSD installation where tmux(1) would lose its session socket after a few inactive days. Every time that happened I quickly fixed it by sending a SIGUSR1 (as suggested by the man page) to restore the socket session. I also noted that would only happen on one mac

Re: daily(8) scratch and junk files removal

2014-07-02 Thread Rafael Zalamena
On Wed, Jul 02, 2014 at 08:49:34AM -0500, Shawn K. Quinn wrote: > On Tue, 2014-07-01 at 19:07 -0300, Rafael Zalamena wrote: > > I also noted that would only happen on one machine which I had setup > > one partition for /var/tmp and /tmp (and /tmp -> /var/tmp). After some > &g

Re: L2VPN in OpenBSD

2014-08-19 Thread Rafael Zalamena
On Tue, Aug 19, 2014 at 03:48:51PM -0400, Tim Epkes wrote: > All, > > I noticed in a few write-ups by Claudio that PWE3 and VPLS were next on the > roadmap. This seemed to be a few years ago. Any progress in that regard? > Is their a page that tracks that status? Very interested, Thanks > > T

VPLS patch [0/3]: introduction

2014-09-14 Thread Rafael Zalamena
The following mails will contain patchs that implement the VPLS datapath in OpenBSD. Applying all patchs should allow people to configure a network using VPLS manually. The first patch prepares the system sources to receive the wire implementation: it turns some mpe specific code into some generic

VPLS patch [1/3]: prepare sys/ to receive pseudowire implementation

2014-09-14 Thread Rafael Zalamena
The following patch is just a preparation for the code that is coming to implement the wire network interface (the VPLS datapath) to work on OpenBSD. This code turns the mpe code that handles route and labels into some general use functions that will be called by mpe and wire. diff --git sys/net/

VPLS patch [2/3]: the wire (pseudowire) implementation

2014-09-14 Thread Rafael Zalamena
} +#endif /* NWIRE */ else { error = EINVAL; break; diff --git sys/net/if_wire.c sys/net/if_wire.c new file mode 100644 index 000..41840cf --- /dev/null +++ sys/net/if_wire.c @@ -0,0 +1,366 @@ +/* + * Copyright (c) 2014 Rafael Zalamena

VPLS patch [3/3]: ifconfig(8) wire support

2014-09-14 Thread Rafael Zalamena
Adds support for wire configuration and status printing. diff --git sbin/ifconfig/ifconfig.c sbin/ifconfig/ifconfig.c index 133ff55..3a363ff 100644 --- sbin/ifconfig/ifconfig.c +++ sbin/ifconfig/ifconfig.c @@ -122,6 +122,10 @@ struct sockaddr_in netmask; #ifndef SMALL struct ifaliasreq

Re: VPLS patch [2/3]: the wire (pseudowire) implementation

2014-09-20 Thread Rafael Zalamena
On Sun, Sep 14, 2014 at 11:51:07PM -0300, Rafael Zalamena wrote: > The following patch implements the basics of the wire network interface. > > --- snipped --- I've added support for tcpdump'ing the wire interface, it will get all data flowing through the wire without the MPL

Re: VPLS patch [3/3]: ifconfig(8) wire support

2014-09-20 Thread Rafael Zalamena
On Sun, Sep 14, 2014 at 11:52:22PM -0300, Rafael Zalamena wrote: > Adds support for wire configuration and status printing. > > --- snipped --- This patch fixes the ifconfig(8) default encapsulation to 'ethernet', as it should only display 'none' when it's

mpe patch: use rt_ifa_{add,del}

2014-10-01 Thread Rafael Zalamena
This new diff aims to simplify the mpe(4) device and also to improve the old code that handled the installation of MPLS interface routes. I followed what mpi@ said: On Tue, Sep 30, 2014 at 11:00:25AM +0200, Martin Pieuchot wrote: > Hello Rafael, > > On 14/09/14(Sun) 23:49, Rafael Zalam

Re: mpe patch: use rt_ifa_{add,del}

2014-10-04 Thread Rafael Zalamena
On Thu, Oct 02, 2014 at 02:36:12PM +0200, Martin Pieuchot wrote: > On 01/10/14(Wed) 21:54, Rafael Zalamena wrote: > > --- old chat snip --- > > > > Code change: > > * Moved label address from softc to lladdr ifa > > I'm afraid this is not what we want.

Re: mpe patch: use rt_ifa_{add,del}

2014-10-07 Thread Rafael Zalamena
On Sat, Oct 04, 2014 at 07:39:03PM -0300, Rafael Zalamena wrote: > On Thu, Oct 02, 2014 at 02:36:12PM +0200, Martin Pieuchot wrote: > > On 01/10/14(Wed) 21:54, Rafael Zalamena wrote: > > > --- old chat snip --- > Code changed: * Replaced old function that used to crea

Re: mpe patch: use rt_ifa_{add,del}

2014-10-08 Thread Rafael Zalamena
On Wed, Oct 08, 2014 at 09:22:44AM +0200, Martin Pieuchot wrote: > On 07/10/14(Tue) 18:44, Rafael Zalamena wrote: > > On Sat, Oct 04, 2014 at 07:39:03PM -0300, Rafael Zalamena wrote: > > > On Thu, Oct 02, 2014 at 02:36:12PM +0200, Martin Pieuchot wrote: > > > >

Re: mpe patch: use rt_ifa_{add,del}

2014-10-14 Thread Rafael Zalamena
On Wed, Oct 08, 2014 at 06:54:14PM -0300, Rafael Zalamena wrote: > On Wed, Oct 08, 2014 at 09:22:44AM +0200, Martin Pieuchot wrote: > > On 07/10/14(Tue) 18:44, Rafael Zalamena wrote: > > > On Sat, Oct 04, 2014 at 07:39:03PM -0300, Rafael Zalamena wrote: > > > > On T

ether_ifdetach: remove unreachable code

2014-11-11 Thread Rafael Zalamena
Remove unreachable code from ether_ifdetach, it has been marked that way for almost 11 years. Index: net/if_ethersubr.c === RCS file: /home/rzalamena/obsdcvs/src/sys/net/if_ethersubr.c,v retrieving revision 1.177 diff -u -p -u -r1.177

VLAN + bridge regression

2014-11-11 Thread Rafael Zalamena
The diff attached to this mail fixes the bridge output for VLANs noted in this link: http://marc.info/?l=openbsd-misc&m=141508025731320&w=2 Now when we are doing VLAN input we check whether the VLAN is a bridge port or not, if it does then we have to do nothing and just pass the packet and the bri

Re: VLAN + bridge regression

2014-11-13 Thread Rafael Zalamena
On Thu, Nov 13, 2014 at 04:19:23PM +0100, Martin Pieuchot wrote: > On 12/11/14(Wed) 00:22, Rafael Zalamena wrote: > > The diff attached to this mail fixes the bridge output for VLANs noted in > > this link: > > http://marc.info/?l=openbsd-misc&m=141508025731320&w=2 &

Re: VPLS patch [0/3]: introduction

2014-11-14 Thread Rafael Zalamena
On Sun, Sep 14, 2014 at 11:48:11PM -0300, Rafael Zalamena wrote: > The following mails will contain patchs that implement the VPLS datapath > in OpenBSD. Applying all patchs should allow people to configure a > network using VPLS manually. > > --- snipped diffs descriptions ---

Re: VPLS patch [1/3]: prepare sys/ to receive pseudowire implementation

2014-11-14 Thread Rafael Zalamena
On Tue, Sep 30, 2014 at 11:00:25AM +0200, Martin Pieuchot wrote: > Hello Rafael, > > On 14/09/14(Sun) 23:49, Rafael Zalamena wrote: > > The following patch is just a preparation for the code that is coming to > > implement the wire network interface (the VPLS datapat

Re: VPLS patch [2/3]: the wire (pseudowire) implementation

2014-11-14 Thread Rafael Zalamena
On Sat, Sep 20, 2014 at 12:33:11PM -0300, Rafael Zalamena wrote: > On Sun, Sep 14, 2014 at 11:51:07PM -0300, Rafael Zalamena wrote: > > The following patch implements the basics of the wire network interface. > > > > --- snipped --- > > I've added support for tc

Re: VPLS patch [3/3]: ifconfig(8) wire support

2014-11-14 Thread Rafael Zalamena
On Sat, Sep 20, 2014 at 12:43:09PM -0300, Rafael Zalamena wrote: > On Sun, Sep 14, 2014 at 11:52:22PM -0300, Rafael Zalamena wrote: > > Adds support for wire configuration and status printing. > > > > --- snipped --- > > This patch fixes the ifconfig(8) default encaps

Re: VPLS patch [0/3]: introduction

2014-11-14 Thread Rafael Zalamena
On Fri, Nov 14, 2014 at 05:41:32PM +0100, Mike Belopuhov wrote: > On 14 November 2014 17:26, Rafael Zalamena wrote: > > On Sun, Sep 14, 2014 at 11:48:11PM -0300, Rafael Zalamena wrote: > >> The following mails will contain patchs that implement the VPLS datapath > >&g

QinQ regression

2014-11-18 Thread Rafael Zalamena
The diff inlined in this mail fixes a regression introduced by a commit that removed the VLAN tagging from vlan_start. Since ether_addheader is only called once now (by the first and the inner most VLAN) we need to add tags there. Doing all the tagging in ether_addheader avoids all the ether_heade

Re: mpe(4) broken on -current

2015-03-21 Thread Rafael Zalamena
On Thu, Mar 19, 2015 at 11:50 PM, Rafael Zalamena wrote: > On Thu, Mar 19, 2015 at 8:32 AM, Martin Pieuchot wrote: >> On 18/03/15(Wed) 22:58, Rafael Zalamena wrote: >>> mpe(4) is not installing routes / label in the interface in -current. >>> >>> Snippe

  1   2   >