Tue Oct 27 17:07:14 2020 UTC ()
Fix Linux pfInit() parameter order for mopd

>From dreamlayers


(abs)
diff -r1.1 -r1.2 src/usr.sbin/mopd/common/pf-linux2.c

cvs diff -r1.1 -r1.2 src/usr.sbin/mopd/common/pf-linux2.c (expand / switch to unified diff)

--- src/usr.sbin/mopd/common/pf-linux2.c 2016/06/08 01:11:49 1.1
+++ src/usr.sbin/mopd/common/pf-linux2.c 2020/10/27 17:07:14 1.2
@@ -1,39 +1,39 @@ @@ -1,39 +1,39 @@
1/* $NetBSD: pf-linux2.c,v 1.1 2016/06/08 01:11:49 christos Exp $ */ 1/* $NetBSD: pf-linux2.c,v 1.2 2020/10/27 17:07:14 abs Exp $ */
2 2
3/* 3/*
4 * General Purpose AppleTalk Packet Filter Interface 4 * General Purpose AppleTalk Packet Filter Interface
5 * 5 *
6 * Copyright (c) 1992-1995, The University of Melbourne. 6 * Copyright (c) 1992-1995, The University of Melbourne.
7 * All Rights Reserved. Permission to redistribute or 7 * All Rights Reserved. Permission to redistribute or
8 * use any part of this software for any purpose must 8 * use any part of this software for any purpose must
9 * be obtained in writing from the copyright owner. 9 * be obtained in writing from the copyright owner.
10 * 10 *
11 * This software is supplied "as is" without express 11 * This software is supplied "as is" without express
12 * or implied warranty. 12 * or implied warranty.
13 * 13 *
14 * djh@munnari.OZ.AU 14 * djh@munnari.OZ.AU
15 * 15 *
16 * Supports: 16 * Supports:
17 * Linux SOCK_PACKET 17 * Linux SOCK_PACKET
18 *  18 *
19 * 19 *
20 * Modified for use with the linux-mopd port by Karl Maftoum  20 * Modified for use with the linux-mopd port by Karl Maftoum
21 * u963870@student.canberra.edu.au 21 * u963870@student.canberra.edu.au
22 * 22 *
23 */ 23 */
24 24
25#include "port.h" 25#include "port.h"
26__RCSID("$NetBSD: pf-linux2.c,v 1.1 2016/06/08 01:11:49 christos Exp $"); 26__RCSID("$NetBSD: pf-linux2.c,v 1.2 2020/10/27 17:07:14 abs Exp $");
27 27
28/* 28/*
29 * include header files 29 * include header files
30 * 30 *
31 */ 31 */
32 32
33#include <stdio.h> 33#include <stdio.h>
34#include <fcntl.h> 34#include <fcntl.h>
35#include <unistd.h> 35#include <unistd.h>
36#include <sys/types.h> 36#include <sys/types.h>
37#include <sys/time.h> 37#include <sys/time.h>
38#include <sys/ioctl.h> 38#include <sys/ioctl.h>
39#include <sys/file.h> 39#include <sys/file.h>
@@ -76,27 +76,27 @@ extern int errno; @@ -76,27 +76,27 @@ extern int errno;
76extern int promisc; 76extern int promisc;
77 77
78struct RDS RDS[NUMRDS]; 78struct RDS RDS[NUMRDS];
79static int setup_pf(int, int, u_short); 79static int setup_pf(int, int, u_short);
80 80
81/* 81/*
82 * Open and initialize packet filter 82 * Open and initialize packet filter
83 * for a particular protocol type. 83 * for a particular protocol type.
84 * 84 *
85 */ 85 */
86 86
87 87
88int 88int
89pfInit(char *interface, u_short protocol, int typ, int mode) 89pfInit(char *interface, int mode, u_short protocol, int typ)
90{ 90{
91 int s; 91 int s;
92 int ioarg; 92 int ioarg;
93 char device[64]; 93 char device[64];
94 unsigned long if_flags; 94 unsigned long if_flags;
95 95
96 96
97 { u_short prot; 97 { u_short prot;
98 98
99 prot = ((typ == TRANS_8023) ? htons(ETH_P_802_2) : htons(protocol)); 99 prot = ((typ == TRANS_8023) ? htons(ETH_P_802_2) : htons(protocol));
100 if ((s = socket(AF_INET, SOCK_PACKET, prot)) < 0) { 100 if ((s = socket(AF_INET, SOCK_PACKET, prot)) < 0) {
101 perror(interface); 101 perror(interface);
102 return(-1); 102 return(-1);