From ab17ebef16a04180b2ede8c8ed07cd9c1871ae42 Mon Sep 17 00:00:00 2001 From: Antoine Verheijen Date: Mon, 8 Feb 2010 15:45:25 -0700 Subject: [PATCH] Add support for OpenBSD 4.6 Add config param header and sysname number for OpenBSD 4.6. As well, add an additional parameter to a call to ifa_ifwithnet() when looking up the MTU for an interface to indicate that the call should use the default routing table. With the advent of OpenBSD 4.6, the system has started to make provisions for multiple routing tables which included a change to the calling sequence for this routine. Change-Id: Idb53efef0e229ca26bd587f2f8cd9df8a0248227 Reviewed-on: http://gerrit.openafs.org/1265 Reviewed-by: Derrick Brashear Tested-by: Derrick Brashear --- src/config/afs_sysnames.h | 1 + src/config/param.i386_obsd46.h | 16 ++++++++ src/config/param.obsd46.h | 74 ++++++++++++++++++++++++++++++++++ src/rx/rx_kernel.h | 4 ++ 4 files changed, 95 insertions(+) create mode 100644 src/config/param.i386_obsd46.h create mode 100644 src/config/param.obsd46.h diff --git a/src/config/afs_sysnames.h b/src/config/afs_sysnames.h index 92ce47778..53f2a2a3a 100644 --- a/src/config/afs_sysnames.h +++ b/src/config/afs_sysnames.h @@ -254,6 +254,7 @@ #define SYS_NAME_ID_i386_obsd43 2612 #define SYS_NAME_ID_i386_obsd44 2613 #define SYS_NAME_ID_i386_obsd45 2614 +#define SYS_NAME_ID_i386_obsd46 2615 #define SYS_NAME_ID_amd64_linux2 2700 #define SYS_NAME_ID_amd64_linux22 2701 diff --git a/src/config/param.i386_obsd46.h b/src/config/param.i386_obsd46.h new file mode 100644 index 000000000..7232ce092 --- /dev/null +++ b/src/config/param.i386_obsd46.h @@ -0,0 +1,16 @@ +/* + * Thanks to Jim Rees and University of Michigan CITI, for the initial + * OpenBSD porting work. + */ + +#ifndef AFS_I386_PARAM_H +#define AFS_I386_PARAM_H + +#define SYS_NAME "i386_obsd46" +#define SYS_NAME_ID SYS_NAME_ID_i386_obsd46 + +#define AFS_X86_XBSD_ENV 1 +#define AFS_X86_ENV 1 +#define AFSLITTLE_ENDIAN 1 + +#endif /* AFS_I386_PARAM_H */ diff --git a/src/config/param.obsd46.h b/src/config/param.obsd46.h new file mode 100644 index 000000000..38786ad14 --- /dev/null +++ b/src/config/param.obsd46.h @@ -0,0 +1,74 @@ +/* + * Thanks to Jim Rees and University of Michigan CITI, for the initial + * OpenBSD porting work. + */ + +#ifndef AFS_PARAM_H +#define AFS_PARAM_H + +#ifndef IGNORE_STDS_H +#include +#endif + +#define AFS_XBSD_ENV 1 /* {Free,Open,Net}BSD */ + +#define AFS_NAMEI_ENV 1 /* User space interface to file system */ +#define AFS_64BIT_ENV 1 +#define AFS_64BIT_CLIENT 1 +#define AFS_64BIT_IOPS_ENV 1 /* Needed for NAMEI */ + +#define AFS_OBSD_ENV 1 +#define AFS_OBSD31_ENV 1 +#define AFS_OBSD32_ENV 1 +#define AFS_OBSD33_ENV 1 +#define AFS_OBSD34_ENV 1 +#define AFS_OBSD35_ENV 1 +#define AFS_OBSD36_ENV 1 +#define AFS_OBSD37_ENV 1 +#define AFS_OBSD38_ENV 1 +#define AFS_OBSD39_ENV 1 +#define AFS_OBSD40_ENV 1 +#define AFS_OBSD41_ENV 1 +#define AFS_OBSD42_ENV 1 +#define AFS_OBSD43_ENV 1 +#define AFS_OBSD44_ENV 1 +#define AFS_OBSD45_ENV 1 +#define AFS_OBSD46_ENV 1 +#undef AFS_NONFSTRANS +#define AFS_NONFSTRANS 1 +#define AFS_VM_RDWR_ENV 1 +#define AFS_VFS_ENV 1 +#define AFS_VFSINCL_ENV 1 + +#define FTRUNC O_TRUNC + +#define AFS_SYSCALL 208 +#define AFS_MOUNT_AFS "afs" + +#define RXK_LISTENER_ENV 1 +#define AFS_GCPAGS 0 /* if nonzero, garbage collect PAGs */ +#define AFS_USE_GETTIMEOFDAY 1 /* use gettimeofday to implement rx clock */ + +#ifndef IGNORE_STDS_H +#include +#endif + +/* Extra kernel definitions (from kdefs file) */ +#ifdef _KERNEL +#define AFS_GLOBAL_SUNLOCK 1 +#define AFS_SHORTGID 0 /* are group id's short? */ + +#if !defined(ASSEMBLER) && !defined(__LANGUAGE_ASSEMBLY__) +enum vcexcl { NONEXCL, EXCL }; + +#ifndef MIN +#define MIN(A,B) ((A) < (B) ? (A) : (B)) +#endif +#ifndef MAX +#define MAX(A,B) ((A) > (B) ? (A) : (B)) +#endif + +#endif /* ! ASSEMBLER & ! __LANGUAGE_ASSEMBLY__ */ +#endif /* _KERNEL */ + +#endif /* AFS_PARAM_H */ diff --git a/src/rx/rx_kernel.h b/src/rx/rx_kernel.h index 75becc5be..63fd71ede 100644 --- a/src/rx/rx_kernel.h +++ b/src/rx/rx_kernel.h @@ -52,7 +52,11 @@ extern int osi_utoa(char *buf, size_t len, unsigned long val); #endif #define rx_ifnet_mtu(x) (x)->if_mtu #define rx_ifnet_flags(x) (x?(x)->if_flags:0) +#ifdef AFS_OBSD46_ENV +#define rx_ifaddr_withnet(x) ifa_ifwithnet(x, 0) +#else #define rx_ifaddr_withnet(x) ifa_ifwithnet(x) +#endif #define rx_ifnet_metric(x) (x?(x)->if_data.ifi_metric:0) #define rx_ifaddr_ifnet(x) (x?(x)->ifa_ifp:0) #define rx_ifaddr_address_family(x) (x)->ifa_addr->sa_family -- 2.39.5