svn commit: r196652 - head/usr.bin/w

2009-08-30 Thread Hajimu UMEMOTO
Author: ume
Date: Sun Aug 30 11:17:42 2009
New Revision: 196652
URL: http://svn.freebsd.org/changeset/base/196652

Log:
  Fix the problem that the entry broke into two lines with multi-byte
  AM/PM format.
  
  Reported by:  takawata

Modified:
  head/usr.bin/w/extern.h
  head/usr.bin/w/pr_time.c
  head/usr.bin/w/w.c

Modified: head/usr.bin/w/extern.h
==
--- head/usr.bin/w/extern.h Sun Aug 30 10:47:00 2009(r196651)
+++ head/usr.bin/w/extern.h Sun Aug 30 11:17:42 2009(r196652)
@@ -38,6 +38,6 @@
 extern int use_ampm;
 
 struct kinfo_proc;
-void   pr_attime(time_t *, time_t *);
+intpr_attime(time_t *, time_t *);
 intpr_idle(time_t);
 intproc_compare(struct kinfo_proc *, struct kinfo_proc *);

Modified: head/usr.bin/w/pr_time.c
==
--- head/usr.bin/w/pr_time.cSun Aug 30 10:47:00 2009(r196651)
+++ head/usr.bin/w/pr_time.cSun Aug 30 11:17:42 2009(r196652)
@@ -52,13 +52,14 @@ static const char sccsid[] = @(#)pr_tim
  * pr_attime --
  * Print the time since the user logged in.
  */
-void
+int
 pr_attime(time_t *started, time_t *now)
 {
-   static char buf[256];
+   static wchar_t buf[256];
struct tm tp, tm;
time_t diff;
-   char fmt[20];
+   wchar_t *fmt;
+   int len, width, offset = 0;
 
tp = *localtime(started);
tm = *localtime(now);
@@ -66,7 +67,7 @@ pr_attime(time_t *started, time_t *now)
 
/* If more than a week, use day-month-year. */
if (diff  86400 * 7)
-   (void)strcpy(fmt, %d%b%y);
+   fmt = L%d%b%y;
 
/* If not today, use day-hour-am/pm. */
else if (tm.tm_mday != tp.tm_mday ||
@@ -74,16 +75,26 @@ pr_attime(time_t *started, time_t *now)
 tm.tm_year != tp.tm_year) {
/* The line below does not take DST into consideration */
/* else if (*now / 86400 != *started / 86400) { */
-   (void)strcpy(fmt, use_ampm ? %a%I%p : %a%H);
+   fmt = use_ampm ? L%a%I%p : L%a%H;
}
 
/* Default is hh:mm{am,pm}. */
else {
-   (void)strcpy(fmt, use_ampm ? %l:%M%p : %k:%M);
+   fmt = use_ampm ? L%l:%M%p : L%k:%M;
}
 
-   (void)strftime(buf, sizeof(buf), fmt, tp);
-   (void)wprintf(L%-7.7s, buf);
+   (void)wcsftime(buf, sizeof(buf), fmt, tp);
+   len = wcslen(buf);
+   width = wcswidth(buf, len);
+   if (len == width)
+   (void)wprintf(L%-7.7ls, buf);
+   else if (width  7)
+   (void)wprintf(L%ls%.*s, buf, 7 - width,   );
+   else {
+   (void)wprintf(L%ls, buf);
+   offset = width - 7;
+   }
+   return (offset);
 }
 
 /*

Modified: head/usr.bin/w/w.c
==
--- head/usr.bin/w/w.c  Sun Aug 30 10:47:00 2009(r196651)
+++ head/usr.bin/w/w.c  Sun Aug 30 11:17:42 2009(r196652)
@@ -137,7 +137,7 @@ main(int argc, char *argv[])
struct stat *stp;
FILE *ut;
time_t touched;
-   int ch, i, nentries, nusers, wcmd, longidle, dropgid;
+   int ch, i, nentries, nusers, wcmd, longidle, longattime, dropgid;
const char *memf, *nlistf, *p;
char *x_suffix;
char buf[MAXHOSTNAMELEN], errbuf[_POSIX2_LINE_MAX];
@@ -406,9 +406,10 @@ main(int argc, char *argv[])
ep-utmp.ut_line : ep-utmp.ut_line + 3,
W_DISPHOSTSIZE, W_DISPHOSTSIZE, *p ? p : -);
t = _time_to_time32(ep-utmp.ut_time);
-   pr_attime(t, now);
+   longattime = pr_attime(t, now);
longidle = pr_idle(ep-idle);
-   (void)printf(%.*s\n, argwidth - longidle, ep-args);
+   (void)printf(%.*s\n, argwidth - longidle - longattime,
+   ep-args);
}
(void)kvm_close(kd);
exit(0);
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


Re: svn commit: r196650 - head/lib/libpam/modules/pam_lastlog

2009-08-30 Thread Jaakko Heinonen
On 2009-08-30, Jonathan Chen wrote:
 New Revision: 196650
 
   Prevents pam_lastlog from segfaulting on session close when tty is null.

Thanks! This is PR bin/112694.

-- 
Jaakko
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r196654 - head/share/man/man4

2009-08-30 Thread Motoyuki Konno
Author: motoyuki
Date: Sun Aug 30 14:45:09 2009
New Revision: 196654
URL: http://svn.freebsd.org/changeset/base/196654

Log:
  Fix the reference for the IPV6_V6ONLY option.  This option is described
  in RFC 3493, not 3542.
  
  PR:   docs/134127
  Submitted by: Kenji Rikitake kenji.rikit...@acm.org
  MFC after:2 weeks

Modified:
  head/share/man/man4/ip6.4

Modified: head/share/man/man4/ip6.4
==
--- head/share/man/man4/ip6.4   Sun Aug 30 14:38:17 2009(r196653)
+++ head/share/man/man4/ip6.4   Sun Aug 30 14:45:09 2009(r196654)
@@ -692,7 +692,7 @@ An ancillary data object was improperly 
 Most of the socket options are defined in RFC 2292 or RFC 2553.
 The
 .Dv IPV6_V6ONLY
-socket option is defined in RFC 3542.
+socket option is defined in RFC 3493 Section 5.3.
 The
 .Dv IPV6_PORTRANGE
 socket option and the conflict resolution rule are not defined in the
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r196655 - head/sys/dev/siis

2009-08-30 Thread Alexander Motin
Author: mav
Date: Sun Aug 30 15:06:03 2009
New Revision: 196655
URL: http://svn.freebsd.org/changeset/base/196655

Log:
  MFp4:
   - Add SNTF support.
   - Do not report meaningless transport/protocol versions.

Modified:
  head/sys/dev/siis/siis.c

Modified: head/sys/dev/siis/siis.c
==
--- head/sys/dev/siis/siis.cSun Aug 30 14:45:09 2009(r196654)
+++ head/sys/dev/siis/siis.cSun Aug 30 15:06:03 2009(r196655)
@@ -647,6 +647,30 @@ siis_slotsfree(device_t dev)
 }
 
 static void
+siis_notify_events(device_t dev)
+{
+   struct siis_channel *ch = device_get_softc(dev);
+   struct cam_path *dpath;
+   u_int32_t status;
+   int i;
+
+   status = ATA_INL(ch-r_mem, SIIS_P_SNTF);
+   ATA_OUTL(ch-r_mem, SIIS_P_SNTF, status);
+   if (bootverbose)
+   device_printf(dev, SNTF 0x%04x\n, status);
+   for (i = 0; i  16; i++) {
+   if ((status  (1  i)) == 0)
+   continue;
+   if (xpt_create_path(dpath, NULL,
+   xpt_path_path_id(ch-path), i, 0) == CAM_REQ_CMP) {
+   xpt_async(AC_SCSI_AEN, dpath, NULL);
+   xpt_free_path(dpath);
+   }
+   }
+
+}
+
+static void
 siis_phy_check_events(device_t dev)
 {
struct siis_channel *ch = device_get_softc(dev);
@@ -707,6 +731,9 @@ siis_ch_intr(void *data)
/* Process PHY events */
if (istatus  SIIS_P_IX_PHYRDYCHG)
siis_phy_check_events(dev);
+   /* Process NOTIFY events */
+   if (istatus  SIIS_P_IX_SDBN)
+   siis_notify_events(dev);
/* Process command errors */
if (istatus  SIIS_P_IX_COMMERR) {
estatus = ATA_INL(ch-r_mem, SIIS_P_CMDERR);
@@ -1267,7 +1294,6 @@ siis_reset(device_t dev)
/* XXX; Commands in loading state. */
siis_end_transaction(ch-slot[i], SIIS_ERR_INNOCENT);
}
-   ATA_OUTL(ch-r_mem, SIIS_P_CTLCLR, SIIS_P_CTL_PME);
/* Reset and reconnect PHY, */
if (!siis_sata_phy_reset(dev)) {
ch-devices = 0;
@@ -1461,9 +1487,9 @@ siisaction(struct cam_sim *sim, union cc
uint32_t status;
 
cts-protocol = PROTO_ATA;
-   cts-protocol_version = SCSI_REV_2;
+   cts-protocol_version = PROTO_VERSION_UNSPECIFIED;
cts-transport = XPORT_SATA;
-   cts-transport_version = 2;
+   cts-transport_version = XPORT_VERSION_UNSPECIFIED;
cts-proto_specific.valid = 0;
cts-xport_specific.sata.valid = 0;
if (cts-type == CTS_TYPE_CURRENT_SETTINGS)
@@ -1548,9 +1574,9 @@ siisaction(struct cam_sim *sim, union cc
strncpy(cpi-dev_name, cam_sim_name(sim), DEV_IDLEN);
cpi-unit_number = cam_sim_unit(sim);
cpi-transport = XPORT_SATA;
-   cpi-transport_version = 2;
+   cpi-transport_version = XPORT_VERSION_UNSPECIFIED;
cpi-protocol = PROTO_ATA;
-   cpi-protocol_version = SCSI_REV_2;
+   cpi-protocol_version = PROTO_VERSION_UNSPECIFIED;
cpi-ccb_h.status = CAM_REQ_CMP;
cpi-maxio = MAXPHYS;
xpt_done(ccb);
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r196656 - in head: share/man/man4 sys/dev/ahci

2009-08-30 Thread Alexander Motin
Author: mav
Date: Sun Aug 30 15:20:13 2009
New Revision: 196656
URL: http://svn.freebsd.org/changeset/base/196656

Log:
  MFp4:
   - Add Command Completion Coalescing support.
   - Add SNTF support.
   - Add two more power management modes (4, 5), implemented on driver level.
   - Fix interface mode setting.
   - Reduce interface reset time.
   - Do not report meaningless protocol/transport versions.
   - Report CAP2 register content.
   - Some performance optimizations.

Modified:
  head/share/man/man4/ahci.4
  head/sys/dev/ahci/ahci.c
  head/sys/dev/ahci/ahci.h

Modified: head/share/man/man4/ahci.4
==
--- head/share/man/man4/ahci.4  Sun Aug 30 15:06:03 2009(r196655)
+++ head/share/man/man4/ahci.4  Sun Aug 30 15:20:13 2009(r196656)
@@ -25,7 +25,7 @@
 .\
 .\ $FreeBSD$
 .\
-.Dd June 26, 2009
+.Dd August 24, 2009
 .Dt AHCI 4
 .Os
 .Sh NAME
@@ -60,6 +60,13 @@ single MSI vector used, if supported (de
 .It 2
 multiple MSI vectors used, if supported;
 .El
+.It Va hint.ahci.X.ccc
+controls Command Completion Coalescing (CCC) usage by the specified controller.
+Non-zero value enables CCC and defines maximum time (in ms), request can wait
+for interrupt, if there are some more requests present on controller queue.
+CCC reduces number of context switches on systems with many parallel requests,
+but it can decrease disk performance on some workloads due to additional
+command latency.
 .It Va hint.ahcich.X.pm_level
 controls SATA interface Power Management for specified channel,
 allowing some power to be saved at the cost of additional command
@@ -74,7 +81,15 @@ device is allowed to initiate PM state c
 host initiates PARTIAL PM state transition every time port becomes idle;
 .It 3
 host initiates SLUMBER PM state transition every time port becomes idle.
+.It 4
+driver initiates PARTIAL PM state transition 1ms after port becomes idle;
+.It 5
+driver initiates SLUMBER PM state transition 125ms after port becomes idle.
 .El
+Some controllers, such as ICH8, do not implement modes 2 and 3 with NCQ used.
+Because of artificial entering latency, performance degradation in modes
+4 and 5 is much smaller then in modes 2 and 3.
+.Pp
 Note that interface Power Management is not compatible with
 device presence detection.
 You will have to reset bus manually on device hot-plug.

Modified: head/sys/dev/ahci/ahci.c
==
--- head/sys/dev/ahci/ahci.cSun Aug 30 15:06:03 2009(r196655)
+++ head/sys/dev/ahci/ahci.cSun Aug 30 15:20:13 2009(r196656)
@@ -63,6 +63,7 @@ static int ahci_suspend(device_t dev);
 static int ahci_resume(device_t dev);
 static int ahci_ch_suspend(device_t dev);
 static int ahci_ch_resume(device_t dev);
+static void ahci_ch_pm(void *arg);
 static void ahci_ch_intr_locked(void *data);
 static void ahci_ch_intr(void *data);
 static int ahci_ctlr_reset(device_t dev);
@@ -121,9 +122,11 @@ ahci_attach(device_t dev)
struct ahci_controller *ctlr = device_get_softc(dev);
device_t child;
int error, unit, speed;
-   u_int32_t version, caps;
+   u_int32_t version;
 
ctlr-dev = dev;
+   resource_int_value(device_get_name(dev),
+   device_get_unit(dev), ccc, ctlr-ccc);
/* if we have a memory BAR(5) we are likely on an AHCI part */
ctlr-r_rid = PCIR_BAR(5);
if (!(ctlr-r_mem = bus_alloc_resource_any(dev, SYS_RES_MEMORY,
@@ -160,41 +163,49 @@ ahci_attach(device_t dev)
}
/* Announce HW capabilities. */
version = ATA_INL(ctlr-r_mem, AHCI_VS);
-   caps = ATA_INL(ctlr-r_mem, AHCI_CAP);
-   speed = (caps  AHCI_CAP_ISS)  AHCI_CAP_ISS_SHIFT;
+   ctlr-caps = ATA_INL(ctlr-r_mem, AHCI_CAP);
+   if (version = 0x00010020)
+   ctlr-caps2 = ATA_INL(ctlr-r_mem, AHCI_CAP2);
+   speed = (ctlr-caps  AHCI_CAP_ISS)  AHCI_CAP_ISS_SHIFT;
device_printf(dev,
AHCI v%x.%02x with %d %sGbps ports, Port Multiplier %s\n,
((version  20)  0xf0) + ((version  16)  0x0f),
((version  4)  0xf0) + (version  0x0f),
-   (caps  AHCI_CAP_NPMASK) + 1,
+   (ctlr-caps  AHCI_CAP_NPMASK) + 1,
((speed == 1) ? 1.5:((speed == 2) ? 3:
((speed == 3) ? 6:?))),
-   (caps  AHCI_CAP_SPM) ?
+   (ctlr-caps  AHCI_CAP_SPM) ?
supported : not supported);
if (bootverbose) {
device_printf(dev, Caps:%s%s%s%s%s%s%s%s %sGbps,
-   (caps  AHCI_CAP_64BIT) ?  64bit:,
-   (caps  AHCI_CAP_SNCQ) ?  NCQ:,
-   (caps  AHCI_CAP_SSNTF) ?  SNTF:,
-   (caps  AHCI_CAP_SMPS) ?  MPS:,
-   (caps  AHCI_CAP_SSS) ?  SS:,
-   (caps  AHCI_CAP_SALP) ?  ALP:,
-   (caps  

svn commit: r196657 - head/sys/cam/ata

2009-08-30 Thread Alexander Motin
Author: mav
Date: Sun Aug 30 15:36:56 2009
New Revision: 196657
URL: http://svn.freebsd.org/changeset/base/196657

Log:
  ATA_FLUSHCACHE is a 36bit format command, not 48.

Modified:
  head/sys/cam/ata/ata_da.c

Modified: head/sys/cam/ata/ata_da.c
==
--- head/sys/cam/ata/ata_da.c   Sun Aug 30 15:20:13 2009(r196656)
+++ head/sys/cam/ata/ata_da.c   Sun Aug 30 15:36:56 2009(r196657)
@@ -287,7 +287,7 @@ adaclose(struct disk *dp)
if (softc-flags  ADA_FLAG_CAN_48BIT)
ata_48bit_cmd(ccb-ataio, ATA_FLUSHCACHE48, 0, 0, 0);
else
-   ata_48bit_cmd(ccb-ataio, ATA_FLUSHCACHE, 0, 0, 0);
+   ata_36bit_cmd(ccb-ataio, ATA_FLUSHCACHE, 0, 0, 0);
cam_periph_runccb(ccb, /*error_routine*/NULL, /*cam_flags*/0,
/*sense_flags*/SF_RETRY_UA,
softc-disk-d_devstat);
@@ -441,7 +441,7 @@ adadump(void *arg, void *virtual, vm_off
if (softc-flags  ADA_FLAG_CAN_48BIT)
ata_48bit_cmd(ccb.ataio, ATA_FLUSHCACHE48, 0, 0, 0);
else
-   ata_48bit_cmd(ccb.ataio, ATA_FLUSHCACHE, 0, 0, 0);
+   ata_36bit_cmd(ccb.ataio, ATA_FLUSHCACHE, 0, 0, 0);
xpt_polled_action(ccb);
 
if ((ccb.ccb_h.status  CAM_STATUS_MASK) != CAM_REQ_CMP)
@@ -878,7 +878,7 @@ adastart(struct cam_periph *periph, unio
if (softc-flags  ADA_FLAG_CAN_48BIT)
ata_48bit_cmd(ataio, ATA_FLUSHCACHE48, 
0, 0, 0);
else
-   ata_48bit_cmd(ataio, ATA_FLUSHCACHE, 0, 
0, 0);
+   ata_36bit_cmd(ataio, ATA_FLUSHCACHE, 0, 
0, 0);
break;
}
start_ccb-ccb_h.ccb_state = ADA_CCB_BUFFER_IO;
@@ -1126,7 +1126,7 @@ adashutdown(void * arg, int howto)
if (softc-flags  ADA_FLAG_CAN_48BIT)
ata_48bit_cmd(ccb.ataio, ATA_FLUSHCACHE48, 0, 0, 0);
else
-   ata_48bit_cmd(ccb.ataio, ATA_FLUSHCACHE, 0, 0, 0);
+   ata_36bit_cmd(ccb.ataio, ATA_FLUSHCACHE, 0, 0, 0);
xpt_polled_action(ccb);
 
if ((ccb.ccb_h.status  CAM_STATUS_MASK) != CAM_REQ_CMP)
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r196658 - head/sbin/camcontrol

2009-08-30 Thread Alexander Motin
Author: mav
Date: Sun Aug 30 16:08:25 2009
New Revision: 196658
URL: http://svn.freebsd.org/changeset/base/196658

Log:
  MFp4:
   - Tune protocol version reporting,
   - Add supported DMA/PIO modes reporting.
   - Fix IDENTIFY for ATAPI devices.
   - Remove confusing - for NCQ status.

Modified:
  head/sbin/camcontrol/camcontrol.c

Modified: head/sbin/camcontrol/camcontrol.c
==
--- head/sbin/camcontrol/camcontrol.c   Sun Aug 30 15:36:56 2009
(r196657)
+++ head/sbin/camcontrol/camcontrol.c   Sun Aug 30 16:08:25 2009
(r196658)
@@ -206,6 +206,7 @@ static void cts_print(struct cam_device 
  struct ccb_trans_settings *cts);
 static void cpi_print(struct ccb_pathinq *cpi);
 static int get_cpi(struct cam_device *device, struct ccb_pathinq *cpi);
+static int get_cgd(struct cam_device *device, struct ccb_getdev *cgd);
 static int get_print_cts(struct cam_device *device, int user_settings,
 int quiet, struct ccb_trans_settings *cts);
 static int ratecontrol(struct cam_device *device, int retry_count,
@@ -1015,17 +1016,18 @@ atacapprint(struct ata_params *parm)
((u_int64_t)parm-lba_size48_4  48);
 
printf(\n);
-   printf(Protocol  );
+   printf(protocol  );
+   printf(ATA/ATAPI-%d, ata_version(parm-version_major));
if (parm-satacapabilities  parm-satacapabilities != 0x) {
if (parm-satacapabilities  ATA_SATA_GEN2)
-   printf(SATA revision 2.x\n);
+   printf( SATA 2.x\n);
else if (parm-satacapabilities  ATA_SATA_GEN1)
-   printf(SATA revision 1.x\n);
+   printf( SATA 1.x\n);
else
-   printf(Unknown SATA revision\n);
+   printf( SATA x.x\n);
}
else
-   printf(ATA/ATAPI revision %d\n, 
ata_version(parm-version_major));
+   printf(\n);
printf(device model  %.40s\n, parm-model);
printf(serial number %.20s\n, parm-serial);
printf(firmware revision %.8s\n, parm-revision);
@@ -1038,22 +1040,74 @@ atacapprint(struct ata_params *parm)
(parm-support.command2  ATA_SUPPORT_CFA))
printf(CFA supported\n);
 
-   printf(lba%ssupported ,
+   printf(LBA%ssupported ,
parm-capabilities1  ATA_SUPPORT_LBA ?   :  not );
if (lbasize)
printf(%d sectors\n, lbasize);
else
printf(\n);
 
-   printf(lba48%ssupported   ,
+   printf(LBA48%ssupported   ,
parm-support.command2  ATA_SUPPORT_ADDRESS48 ?   :  not );
if (lbasize48)
printf(%ju sectors\n, (uintmax_t)lbasize48);
else
printf(\n);
 
-   printf(dma%ssupported\n,
+   printf(PIO supported PIO);
+   if (parm-atavalid  ATA_FLAG_64_70) {
+   if (parm-apiomodes  0x02)
+   printf(4);
+   else if (parm-apiomodes  0x01)
+   printf(3);
+   } else if (parm-mwdmamodes  0x04)
+   printf(4);
+   else if (parm-mwdmamodes  0x02)
+   printf(3);
+   else if (parm-mwdmamodes  0x01)
+   printf(2);
+   else if ((parm-retired_piomode  ATA_RETIRED_PIO_MASK) == 0x200)
+   printf(2);
+   else if ((parm-retired_piomode  ATA_RETIRED_PIO_MASK) == 0x100)
+   printf(1);
+   else
+   printf(0);
+   printf(\n);
+
+   printf(DMA%ssupported ,
parm-capabilities1  ATA_SUPPORT_DMA ?   :  not );
+   if (parm-capabilities1  ATA_SUPPORT_DMA) {
+   if (parm-mwdmamodes  0xff) {
+   printf(WDMA);
+   if (parm-mwdmamodes  0x04)
+   printf(2);
+   else if (parm-mwdmamodes  0x02)
+   printf(1);
+   else if (parm-mwdmamodes  0x01)
+   printf(0);
+   printf( );
+   }
+   if ((parm-atavalid  ATA_FLAG_88) 
+   (parm-udmamodes  0xff)) {
+   printf(UDMA);
+   if (parm-udmamodes  0x40)
+   printf(6);
+   else if (parm-udmamodes  0x20)
+   printf(5);
+   else if (parm-udmamodes  0x10)
+   printf(4);
+   else if (parm-udmamodes  0x08)
+   printf(3);
+   else if (parm-udmamodes  0x04)
+   printf(2);
+   else if (parm-udmamodes  0x02)
+   

svn commit: r196659 - in head: sbin/camcontrol sys/cam/ata

2009-08-30 Thread Alexander Motin
Author: mav
Date: Sun Aug 30 16:31:25 2009
New Revision: 196659
URL: http://svn.freebsd.org/changeset/base/196659

Log:
  Short ATA command format has 28bit address, not 36bit.
  Rename ata_36bit_cmd() into ata_28bit_cmd(), while it didn't become legacy.
  
  MFC after:2 days

Modified:
  head/sbin/camcontrol/camcontrol.c
  head/sys/cam/ata/ata_all.c
  head/sys/cam/ata/ata_all.h
  head/sys/cam/ata/ata_da.c
  head/sys/cam/ata/ata_xpt.c

Modified: head/sbin/camcontrol/camcontrol.c
==
--- head/sbin/camcontrol/camcontrol.c   Sun Aug 30 16:08:25 2009
(r196658)
+++ head/sbin/camcontrol/camcontrol.c   Sun Aug 30 16:31:25 2009
(r196659)
@@ -1212,9 +1212,9 @@ ataidentify(struct cam_device *device, i
  /*dxfer_len*/sizeof(struct ata_params),
  timeout ? timeout : 30 * 1000);
if (cgd.protocol == PROTO_ATA)
-   ata_36bit_cmd(ccb-ataio, ATA_ATA_IDENTIFY, 0, 0, 0);
+   ata_28bit_cmd(ccb-ataio, ATA_ATA_IDENTIFY, 0, 0, 0);
else
-   ata_36bit_cmd(ccb-ataio, ATA_ATAPI_IDENTIFY, 0, 0, 0);
+   ata_28bit_cmd(ccb-ataio, ATA_ATAPI_IDENTIFY, 0, 0, 0);
 
/* Disable freezing the device queue */
ccb-ccb_h.flags |= CAM_DEV_QFRZDIS;

Modified: head/sys/cam/ata/ata_all.c
==
--- head/sys/cam/ata/ata_all.c  Sun Aug 30 16:08:25 2009(r196658)
+++ head/sys/cam/ata/ata_all.c  Sun Aug 30 16:31:25 2009(r196659)
@@ -91,7 +91,7 @@ ata_print_ident(struct ata_params *ident
 }
 
 void
-ata_36bit_cmd(struct ccb_ataio *ataio, uint8_t cmd, uint8_t features,
+ata_28bit_cmd(struct ccb_ataio *ataio, uint8_t cmd, uint8_t features,
 uint32_t lba, uint8_t sector_count)
 {
bzero(ataio-cmd, sizeof(ataio-cmd));

Modified: head/sys/cam/ata/ata_all.h
==
--- head/sys/cam/ata/ata_all.h  Sun Aug 30 16:08:25 2009(r196658)
+++ head/sys/cam/ata/ata_all.h  Sun Aug 30 16:31:25 2009(r196659)
@@ -83,7 +83,7 @@ struct ata_res {
 intata_version(int ver);
 void   ata_print_ident(struct ata_params *ident_data);
 
-void   ata_36bit_cmd(struct ccb_ataio *ataio, uint8_t cmd, uint8_t features,
+void   ata_28bit_cmd(struct ccb_ataio *ataio, uint8_t cmd, uint8_t features,
 uint32_t lba, uint8_t sector_count);
 void   ata_48bit_cmd(struct ccb_ataio *ataio, uint8_t cmd, uint16_t features,
 uint64_t lba, uint16_t sector_count);

Modified: head/sys/cam/ata/ata_da.c
==
--- head/sys/cam/ata/ata_da.c   Sun Aug 30 16:08:25 2009(r196658)
+++ head/sys/cam/ata/ata_da.c   Sun Aug 30 16:31:25 2009(r196659)
@@ -287,7 +287,7 @@ adaclose(struct disk *dp)
if (softc-flags  ADA_FLAG_CAN_48BIT)
ata_48bit_cmd(ccb-ataio, ATA_FLUSHCACHE48, 0, 0, 0);
else
-   ata_36bit_cmd(ccb-ataio, ATA_FLUSHCACHE, 0, 0, 0);
+   ata_28bit_cmd(ccb-ataio, ATA_FLUSHCACHE, 0, 0, 0);
cam_periph_runccb(ccb, /*error_routine*/NULL, /*cam_flags*/0,
/*sense_flags*/SF_RETRY_UA,
softc-disk-d_devstat);
@@ -411,7 +411,7 @@ adadump(void *arg, void *virtual, vm_off
ata_48bit_cmd(ccb.ataio, ATA_WRITE_DMA48,
0, lba, count);
} else {
-   ata_36bit_cmd(ccb.ataio, ATA_WRITE_DMA,
+   ata_28bit_cmd(ccb.ataio, ATA_WRITE_DMA,
0, lba, count);
}
xpt_polled_action(ccb);
@@ -441,7 +441,7 @@ adadump(void *arg, void *virtual, vm_off
if (softc-flags  ADA_FLAG_CAN_48BIT)
ata_48bit_cmd(ccb.ataio, ATA_FLUSHCACHE48, 0, 0, 0);
else
-   ata_36bit_cmd(ccb.ataio, ATA_FLUSHCACHE, 0, 0, 0);
+   ata_28bit_cmd(ccb.ataio, ATA_FLUSHCACHE, 0, 0, 0);
xpt_polled_action(ccb);
 
if ((ccb.ccb_h.status  CAM_STATUS_MASK) != CAM_REQ_CMP)
@@ -856,10 +856,10 @@ adastart(struct cam_periph *periph, unio
}
} else {
if (bp-bio_cmd == BIO_READ) {
-   ata_36bit_cmd(ataio, 
ATA_READ_DMA,
+   ata_28bit_cmd(ataio, 
ATA_READ_DMA,
0, lba, count);
} else {
-   ata_36bit_cmd(ataio, 
ATA_WRITE_DMA,
+   ata_28bit_cmd(ataio, 
ATA_WRITE_DMA,
  

svn commit: r196660 - head/sys/dev/ahci

2009-08-30 Thread Alexander Motin
Author: mav
Date: Sun Aug 30 19:40:09 2009
New Revision: 196660
URL: http://svn.freebsd.org/changeset/base/196660

Log:
  Fix build with INVARIANTS.

Modified:
  head/sys/dev/ahci/ahci.c

Modified: head/sys/dev/ahci/ahci.c
==
--- head/sys/dev/ahci/ahci.cSun Aug 30 16:31:25 2009(r196659)
+++ head/sys/dev/ahci/ahci.cSun Aug 30 19:40:09 2009(r196660)
@@ -1072,7 +1072,7 @@ ahci_begin_transaction(device_t dev, uni
while (ch-slot[tag].state != AHCI_SLOT_EMPTY) {
if (++tag = ch-numslots)
tag = 0;
-   KASSERT(tag != ch-lastslot, ahci: ALL SLOTS BUSY!);
+   KASSERT(tag != ch-lastslot, (ahci: ALL SLOTS BUSY!));
}
ch-lastslot = tag;
/* Occupy chosen slot. */
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r196661 - head/sys/dev/xen/blkfront

2009-08-30 Thread Kip Macy
Author: kmacy
Date: Sun Aug 30 20:45:24 2009
New Revision: 196661
URL: http://svn.freebsd.org/changeset/base/196661

Log:
  add core dump support to blkfront
  
  Obtained from:Frank Suchomel

Modified:
  head/sys/dev/xen/blkfront/blkfront.c

Modified: head/sys/dev/xen/blkfront/blkfront.c
==
--- head/sys/dev/xen/blkfront/blkfront.cSun Aug 30 19:40:09 2009
(r196660)
+++ head/sys/dev/xen/blkfront/blkfront.cSun Aug 30 20:45:24 2009
(r196661)
@@ -16,7 +16,9 @@
  */
 
 /*
- * XenoBSD block device driver
+ * XenBSD block device driver
+ *
+ * Copyright (c) 2009 Frank Suchomel, Citrix
  */
 
 #include sys/cdefs.h
@@ -122,6 +124,10 @@ static int blkif_ioctl(struct disk *dp, 
 static int blkif_queue_request(struct bio *bp);
 static void xb_strategy(struct bio *bp);
 
+// In order to quiesce the device during kernel dumps, outstanding requests to
+// DOM0 for disk reads/writes need to be accounted for.
+static int blkif_queued_requests;
+static int xb_dump(void *, void *, vm_offset_t, off_t, size_t);
 
 
 /* XXX move to xb_vbd.c when VBD update support is added */
@@ -231,6 +237,7 @@ xlvbd_add(device_t dev, blkif_sector_t c
sc-xb_disk-d_close = blkif_close;
sc-xb_disk-d_ioctl = blkif_ioctl;
sc-xb_disk-d_strategy = xb_strategy;
+   sc-xb_disk-d_dump = xb_dump;
sc-xb_disk-d_name = name;
sc-xb_disk-d_drv1 = sc;
sc-xb_disk-d_sectorsize = sector_size;
@@ -286,9 +293,10 @@ xb_strategy(struct bio *bp)
 * Place it in the queue of disk activities for this disk
 */
mtx_lock(blkif_io_lock);
-   bioq_disksort(sc-xb_bioq, bp);
 
+   bioq_disksort(sc-xb_bioq, bp);
xb_startio(sc);
+
mtx_unlock(blkif_io_lock);
return;
 
@@ -301,6 +309,81 @@ xb_strategy(struct bio *bp)
return;
 }
 
+static void xb_quiesce(struct blkfront_info *info);
+// Quiesce the disk writes for a dump file before allowing the next buffer.
+static void
+xb_quiesce(struct blkfront_info *info)
+{
+   int mtd;
+
+   // While there are outstanding requests
+   while (blkif_queued_requests) {
+   RING_FINAL_CHECK_FOR_RESPONSES(info-ring, mtd);
+   if (mtd) {
+   // Recieved request completions, update queue.
+   blkif_int(info);
+   }
+   if (blkif_queued_requests) {
+   // Still pending requests, wait for the disk i/o to 
complete
+   HYPERVISOR_block();
+   }
+   }
+}
+
+// Some bio structures for dumping core
+#define DUMP_BIO_NO 16 // 16 * 4KB = 64KB dump block
+static struct bio  xb_dump_bp[DUMP_BIO_NO];
+
+// Kernel dump function for a paravirtualized disk device
+static int
+xb_dump(void *arg, void *virtual, vm_offset_t physical, off_t offset,
+size_t length)
+{
+   int  sbp;
+   int  mbp;
+   size_t   chunk;
+   struct  disk*dp = arg;
+   struct  xb_softc*sc = (struct xb_softc *) dp-d_drv1;
+   int  rc = 0;
+
+   xb_quiesce(sc-xb_info);// All quiet on the western 
front.
+   if (length  0) {
+   // If this lock is held, then this module is failing, and a 
successful
+   // kernel dump is highly unlikely anyway.
+   mtx_lock(blkif_io_lock);
+   // Split the 64KB block into 16 4KB blocks
+   for (sbp=0; length0  sbpDUMP_BIO_NO; sbp++) {
+   chunk = length  PAGE_SIZE ? PAGE_SIZE : length;
+   xb_dump_bp[sbp].bio_disk   = dp;
+   xb_dump_bp[sbp].bio_pblkno = offset / dp-d_sectorsize;
+   xb_dump_bp[sbp].bio_bcount = chunk;
+   xb_dump_bp[sbp].bio_resid  = chunk;
+   xb_dump_bp[sbp].bio_data   = virtual;
+   xb_dump_bp[sbp].bio_cmd= BIO_WRITE;
+   xb_dump_bp[sbp].bio_done   = NULL;
+
+   bioq_disksort(sc-xb_bioq, xb_dump_bp[sbp]);
+
+   length -= chunk;
+   offset += chunk;
+   virtual = (char *) virtual + chunk;
+   }
+   // Tell DOM0 to do the I/O
+   xb_startio(sc);
+   mtx_unlock(blkif_io_lock);
+
+   // Must wait for the completion: the dump routine reuses the 
same
+   //   16 x 4KB buffer space.
+   xb_quiesce(sc-xb_info);// All quite on the eastern 
front
+   // If there were any errors, bail out...
+   for (mbp=0; mbpsbp; mbp++) {
+  

Re: svn commit: r196650 - head/lib/libpam/modules/pam_lastlog

2009-08-30 Thread Dag-Erling Smørgrav
Jonathan Chen j...@freebsd.org writes:
 Log:
   Prevents pam_lastlog from segfaulting on session close when tty is null.
   
   MFC after:  1 month

Reviewed by:nobody
Approved by:nobody

Please consult MAINTAINERS next time.

DES
-- 
Dag-Erling Smørgrav - d...@des.no
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r196662 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs

2009-08-30 Thread Pawel Jakub Dawidek
Author: pjd
Date: Sun Aug 30 21:03:40 2009
New Revision: 196662
URL: http://svn.freebsd.org/changeset/base/196662

Log:
  Add missing mountpoint vnode locking.
  
  This fixes panic on assertion with DEBUG_VFS_LOCKS and vfs.usermount=1 when
  regular user tries to mount dataset owned by him.
  
  MFC after:1 week

Modified:
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c

Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c
==
--- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.cSun Aug 
30 20:45:24 2009(r196661)
+++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.cSun Aug 
30 21:03:40 2009(r196662)
@@ -729,7 +729,9 @@ zfs_mount(vfs_t *vfsp)
 
vattr.va_mask = AT_UID;
 
+   vn_lock(mvp, LK_SHARED | LK_RETRY);
if (error = VOP_GETATTR(mvp, vattr, cr)) {
+   VOP_UNLOCK(mvp, 0);
goto out;
}
 
@@ -741,12 +743,15 @@ zfs_mount(vfs_t *vfsp)
}
 #else
if (error = secpolicy_vnode_owner(mvp, cr, 
vattr.va_uid)) {
+   VOP_UNLOCK(mvp, 0);
goto out;
}
 
if (error = VOP_ACCESS(mvp, VWRITE, cr, td)) {
+   VOP_UNLOCK(mvp, 0);
goto out;
}
+   VOP_UNLOCK(mvp, 0);
 #endif
 
secpolicy_fs_mount_clearopts(cr, vfsp);
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r196671 - in stable/8/sys: . amd64/include/xen cddl/contrib/opensolaris contrib/dev/acpica contrib/pf dev/xen/xenpci netinet6

2009-08-30 Thread Qing Li
Author: qingli
Date: Sun Aug 30 22:36:46 2009
New Revision: 196671
URL: http://svn.freebsd.org/changeset/base/196671

Log:
  MFC   r196569
  
  When multiple interfaces exist in the system, with each interface having
  an IPv6 address assigned to it, and if an incoming packet received on
  one interface has a packet destination address that belongs to another
  interface, the routing table is consulted to determine how to reach this
  packet destination. Since the packet destination is an interface address,
  the route table will return a host route with the loopback interface as
  rt_ifp. The input code must recognize this fact, instead of using the
  loopback interface, the input code performs a search to find the right
  interface that owns the given IPv6 address.
  
  Reviewed by:  bz, gnn, kmacy
  Approved by:  re

Modified:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)
  stable/8/sys/dev/xen/xenpci/   (props changed)
  stable/8/sys/netinet6/ip6_input.c

Modified: stable/8/sys/netinet6/ip6_input.c
==
--- stable/8/sys/netinet6/ip6_input.c   Sun Aug 30 22:35:20 2009
(r196670)
+++ stable/8/sys/netinet6/ip6_input.c   Sun Aug 30 22:36:46 2009
(r196671)
@@ -628,8 +628,27 @@ passin:
rt6_key(rin6.ro_rt)-sin6_addr)
 #endif
rin6.ro_rt-rt_ifp-if_type == IFT_LOOP) {
-   struct in6_ifaddr *ia6 =
-   (struct in6_ifaddr *)rin6.ro_rt-rt_ifa;
+   int free_ia6 = 0;
+   struct in6_ifaddr *ia6;
+
+   /*
+* found the loopback route to the interface address
+*/
+   if (rin6.ro_rt-rt_gateway-sa_family == AF_LINK) {
+   struct sockaddr_in6 dest6;
+
+   bzero(dest6, sizeof(dest6));
+   dest6.sin6_family = AF_INET6;
+   dest6.sin6_len = sizeof(dest6);
+   dest6.sin6_addr = ip6-ip6_dst;
+   ia6 = (struct in6_ifaddr *)
+   ifa_ifwithaddr((struct sockaddr *)dest6);
+   if (ia6 == NULL)
+   goto bad;
+   free_ia6 = 1;
+   }
+   else
+   ia6 = (struct in6_ifaddr *)rin6.ro_rt-rt_ifa;
 
/*
 * record address information into m_tag.
@@ -647,6 +666,8 @@ passin:
/* Count the packet in the ip address stats */
ia6-ia_ifa.if_ipackets++;
ia6-ia_ifa.if_ibytes += m-m_pkthdr.len;
+   if (ia6 != NULL  free_ia6 != 0)
+   ifa_free(ia6-ia_ifa);
goto hbhcheck;
} else {
char ip6bufs[INET6_ADDRSTRLEN];
@@ -657,6 +678,8 @@ passin:
ip6_sprintf(ip6bufs, ip6-ip6_src),
ip6_sprintf(ip6bufd, ip6-ip6_dst)));
 
+   if (ia6 != NULL  free_ia6 != 0)
+   ifa_free(ia6-ia_ifa);
goto bad;
}
}
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r196672 - in stable/8/sys: . amd64/include/xen cddl/contrib/opensolaris contrib/dev/acpica contrib/pf dev/xen/xenpci netinet

2009-08-30 Thread Qing Li
Author: qingli
Date: Sun Aug 30 22:39:49 2009
New Revision: 196672
URL: http://svn.freebsd.org/changeset/base/196672

Log:
  MFC   r196608
  
  Do not try to free the rt_lle entry of the cached route in
  ip_output() if the cached route was not initialized from the
  flow-table. The rt_lle entry is invalid unless it has been
  initialized through the flow-table.
  
  Reviewed by:  kmacy, rwatson
  Approved by:  re

Modified:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)
  stable/8/sys/dev/xen/xenpci/   (props changed)
  stable/8/sys/netinet/ip_output.c

Modified: stable/8/sys/netinet/ip_output.c
==
--- stable/8/sys/netinet/ip_output.cSun Aug 30 22:36:46 2009
(r196671)
+++ stable/8/sys/netinet/ip_output.cSun Aug 30 22:39:49 2009
(r196672)
@@ -202,10 +202,8 @@ again:
if (ro-ro_rt  ((ro-ro_rt-rt_flags  RTF_UP) == 0 ||
  dst-sin_family != AF_INET ||
  dst-sin_addr.s_addr != ip-ip_dst.s_addr)) {
-   if (!nortfree) {
+   if (!nortfree)
RTFREE(ro-ro_rt);
-   LLE_FREE(ro-ro_lle);
-   }
ro-ro_rt = (struct rtentry *)NULL;
ro-ro_lle = (struct llentry *)NULL;
}
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r196673 - in stable/8/sys: . amd64/include/xen cddl/contrib/opensolaris contrib/dev/acpica contrib/pf dev/xen/xenpci net

2009-08-30 Thread Qing Li
Author: qingli
Date: Sun Aug 30 22:42:32 2009
New Revision: 196673
URL: http://svn.freebsd.org/changeset/base/196673

Log:
  MFC   r196609
  
  In ip_output(), the flow-table module must not try to cache L2/L3
  information for interface of IFF_POINTOPOINT or IFF_LOOPBACK type.
  Since the L2 information (rt_lle) is invalid for these interface
  types, accidental caching attempt will trigger panic when the invalid
  rt_lle reference is accessed.
  
  When installing a new route, or when updating an existing route, the
  user supplied gateway address may be an interface address (this is
  particularly true for point-to-point interface related modules such
  as ppp, if_tun, if_gif). Currently the routing command handler always
  set the RTF_GATEWAY flag if the gateway address is given as part of the
  command paramters. Therefore the gateway address must be verified against
  interface addresses or else the route would be treated as an indirect
  route, thus making that route unusable.
  
  Reviewed by:  kmacy, julian, rwatson
  Approved by:  re

Modified:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)
  stable/8/sys/dev/xen/xenpci/   (props changed)
  stable/8/sys/net/flowtable.c
  stable/8/sys/net/rtsock.c

Modified: stable/8/sys/net/flowtable.c
==
--- stable/8/sys/net/flowtable.cSun Aug 30 22:39:49 2009
(r196672)
+++ stable/8/sys/net/flowtable.cSun Aug 30 22:42:32 2009
(r196673)
@@ -692,6 +692,12 @@ uncached:
struct rtentry *rt = ro-ro_rt;
struct ifnet *ifp = rt-rt_ifp;
 
+   if (ifp-if_flags  (IFF_POINTOPOINT | IFF_LOOPBACK)) {
+   RTFREE(rt);
+   ro-ro_rt = NULL;
+   return (ENOENT);
+   }
+
if (rt-rt_flags  RTF_GATEWAY)
l3addr = rt-rt_gateway;
else

Modified: stable/8/sys/net/rtsock.c
==
--- stable/8/sys/net/rtsock.c   Sun Aug 30 22:39:49 2009(r196672)
+++ stable/8/sys/net/rtsock.c   Sun Aug 30 22:42:32 2009(r196673)
@@ -513,6 +513,39 @@ route_output(struct mbuf *m, struct sock
senderr(error);
}
 
+   /*
+* The given gateway address may be an interface address.
+* For example, issuing a route change command on a route
+* entry that was created from a tunnel, and the gateway
+* address given is the local end point. In this case the 
+* RTF_GATEWAY flag must be cleared or the destination will
+* not be reachable even though there is no error message.
+*/
+   if (info.rti_info[RTAX_GATEWAY] != NULL 
+   info.rti_info[RTAX_GATEWAY]-sa_family != AF_LINK) {
+   struct route gw_ro;
+
+   bzero(gw_ro, sizeof(gw_ro));
+   gw_ro.ro_dst = *info.rti_info[RTAX_GATEWAY];
+   rtalloc_ign(gw_ro, 0);
+   /* 
+* A host route through the loopback interface is 
+* installed for each interface adddress. In pre 8.0
+* releases the interface address of a PPP link type
+* is not reachable locally. This behavior is fixed as 
+* part of the new L2/L3 redesign and rewrite work. The
+* signature of this interface address route is the
+* AF_LINK sa_family type of the rt_gateway, and the
+* rt_ifp has the IFF_LOOPBACK flag set.
+*/
+   if (gw_ro.ro_rt != NULL 
+   gw_ro.ro_rt-rt_gateway-sa_family == AF_LINK 
+   gw_ro.ro_rt-rt_ifp-if_flags  IFF_LOOPBACK)
+   info.rti_flags = ~RTF_GATEWAY;
+   if (gw_ro.ro_rt != NULL)
+   RTFREE(gw_ro.ro_rt);
+   }
+
switch (rtm-rtm_type) {
struct rtentry *saved_nrt;
 
@@ -714,7 +747,7 @@ route_output(struct mbuf *m, struct sock
RT_UNLOCK(rt);
senderr(error);
}
-   rt-rt_flags |= RTF_GATEWAY;
+   rt-rt_flags |= (RTF_GATEWAY  info.rti_flags);
}
if (info.rti_ifa != NULL 
info.rti_ifa != rt-rt_ifa) {
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r196674 - in stable/8/sys: . amd64/include/xen cddl/contrib/opensolaris contrib/dev/acpica contrib/pf dev/xen/xenpci netinet6

2009-08-30 Thread Qing Li
Author: qingli
Date: Sun Aug 30 22:44:12 2009
New Revision: 196674
URL: http://svn.freebsd.org/changeset/base/196674

Log:
  MFC   r196649
  
  Prefix on-link verification is being performed on statically
  configured prefixes. Since these statically configured prefixes
  do not have any associated advertising routers, these prefixes
  are treated as unreachable and those prefix routes are deleted
  from the routing table. Therefore bypass prefixes that are not
  learned from router advertisements during prefix on-link check.
  
  Reviewed by:  hrs
  Approved by:  re

Modified:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)
  stable/8/sys/dev/xen/xenpci/   (props changed)
  stable/8/sys/netinet6/nd6_rtr.c

Modified: stable/8/sys/netinet6/nd6_rtr.c
==
--- stable/8/sys/netinet6/nd6_rtr.c Sun Aug 30 22:42:32 2009
(r196673)
+++ stable/8/sys/netinet6/nd6_rtr.c Sun Aug 30 22:44:12 2009
(r196674)
@@ -1415,6 +1415,9 @@ pfxlist_onlink_check()
if (pr-ndpr_raf_onlink == 0)
continue;
 
+   if (pr-ndpr_raf_auto == 0)
+   continue;
+
if ((pr-ndpr_stateflags  NDPRF_DETACHED) == 0 
find_pfxlist_reachable_router(pr) == NULL)
pr-ndpr_stateflags |= NDPRF_DETACHED;
@@ -1431,6 +1434,9 @@ pfxlist_onlink_check()
if (pr-ndpr_raf_onlink == 0)
continue;
 
+   if (pr-ndpr_raf_auto == 0)
+   continue;
+
if ((pr-ndpr_stateflags  NDPRF_DETACHED) != 0)
pr-ndpr_stateflags = ~NDPRF_DETACHED;
}
@@ -1454,6 +1460,9 @@ pfxlist_onlink_check()
if (pr-ndpr_raf_onlink == 0)
continue;
 
+   if (pr-ndpr_raf_auto == 0)
+   continue;
+
if ((pr-ndpr_stateflags  NDPRF_DETACHED) != 0 
(pr-ndpr_stateflags  NDPRF_ONLINK) != 0) {
if ((e = nd6_prefix_offlink(pr)) != 0) {
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r196679 - in stable/8/sys: . amd64/include/xen cddl/contrib/opensolaris contrib/dev/acpica contrib/pf dev/xen/xenpci net

2009-08-30 Thread Qing Li
Author: qingli
Date: Mon Aug 31 00:18:17 2009
New Revision: 196679
URL: http://svn.freebsd.org/changeset/base/196679

Log:
  As part of r196609, a call to  rtalloc did not take the fib into
  account. So call the appropriate rtalloc_ign_fib() instead of
  calling rtalloc_ign().
  
  Reviewed by:  pointed out by bz
  Approved by:  re

Modified:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)
  stable/8/sys/dev/xen/xenpci/   (props changed)
  stable/8/sys/net/rtsock.c

Modified: stable/8/sys/net/rtsock.c
==
--- stable/8/sys/net/rtsock.c   Mon Aug 31 00:14:37 2009(r196678)
+++ stable/8/sys/net/rtsock.c   Mon Aug 31 00:18:17 2009(r196679)
@@ -527,7 +527,7 @@ route_output(struct mbuf *m, struct sock
 
bzero(gw_ro, sizeof(gw_ro));
gw_ro.ro_dst = *info.rti_info[RTAX_GATEWAY];
-   rtalloc_ign(gw_ro, 0);
+   rtalloc_ign_fib(gw_ro, 0, so-so_fibnum);
/* 
 * A host route through the loopback interface is 
 * installed for each interface adddress. In pre 8.0
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r196678 - head/sys/net

2009-08-30 Thread Qing Li
Author: qingli
Date: Mon Aug 31 00:14:37 2009
New Revision: 196678
URL: http://svn.freebsd.org/changeset/base/196678

Log:
  As part of r196609, a call to  rtalloc did not take the fib into
  account. So call the appropriate rtalloc_ign_fib() instead of
  calling rtalloc_ign().
  
  Reviewed by:i pointed out by bz
  MFC after:immediately

Modified:
  head/sys/net/rtsock.c

Modified: head/sys/net/rtsock.c
==
--- head/sys/net/rtsock.c   Sun Aug 30 23:16:52 2009(r196677)
+++ head/sys/net/rtsock.c   Mon Aug 31 00:14:37 2009(r196678)
@@ -527,7 +527,7 @@ route_output(struct mbuf *m, struct sock
 
bzero(gw_ro, sizeof(gw_ro));
gw_ro.ro_dst = *info.rti_info[RTAX_GATEWAY];
-   rtalloc_ign(gw_ro, 0);
+   rtalloc_ign_fib(gw_ro, 0, so-so_fibnum);
/* 
 * A host route through the loopback interface is 
 * installed for each interface adddress. In pre 8.0
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r196680 - in stable/7/sys: . contrib/pf contrib/pf/net

2009-08-30 Thread Max Laier
Author: mlaier
Date: Mon Aug 31 00:52:10 2009
New Revision: 196680
URL: http://svn.freebsd.org/changeset/base/196680

Log:
  MFC r196551:
Fix argument ordering to memcpy as well as the size of the copy in the
(theoretical) case that pfi_buffer_cnt should be greater than ~_max.
  
Submitted by:   pjd
Reviewed by:{krw,sthen,mark...@openbsd.org

Modified:
  stable/7/sys/   (props changed)
  stable/7/sys/contrib/pf/   (props changed)
  stable/7/sys/contrib/pf/net/pf_if.c

Modified: stable/7/sys/contrib/pf/net/pf_if.c
==
--- stable/7/sys/contrib/pf/net/pf_if.c Mon Aug 31 00:18:17 2009
(r196679)
+++ stable/7/sys/contrib/pf/net/pf_if.c Mon Aug 31 00:52:10 2009
(r196680)
@@ -660,7 +660,7 @@ pfi_address_add(struct sockaddr *sa, int
(%d/%d)\n, pfi_buffer_cnt, PFI_BUFFER_MAX);
return;
}
-   memcpy(pfi_buffer, p, pfi_buffer_cnt * sizeof(*pfi_buffer));
+   memcpy(p, pfi_buffer, pfi_buffer_max * sizeof(*pfi_buffer));
/* no need to zero buffer */
free(pfi_buffer, PFI_MTYPE);
pfi_buffer = p;
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r196683 - in stable/7: lib/libc lib/libc/stdtime usr.sbin/zic

2009-08-30 Thread Edwin Groothuis
Author: edwin
Date: Mon Aug 31 02:22:18 2009
New Revision: 196683
URL: http://svn.freebsd.org/changeset/base/196683

Log:
  MFC of r192625, r192890, r194783, r196587:
  
  r192625:
  MFC of tzcode2009e:
  
  Upgrade of the tzcode from 2004a to 2009e.
  
  Changes are numerous, but include...
  
  - New format of the output of zic, which supports both 32 and 64
bit time_t formats.
  
  - zdump on 64 bit platforms will actually produce some output instead
of doing nothing for a long time.
  
  - linux_base-fX, with X = at least 8, will work without problems related
to the local time again.
  
  The original patch, based on the 2008e, has been running for a long
  time on both my laptop and desktop machine and have been tested by
  other people.
  
  After the installation of this code and the running of zic(8), you
  need to run tzsetup(8) again to install the new datafile.
  
  r192890:
  
  MFC of tzcode2009h
  
  - Clarify the license for the tzcode: public domain
  
  r194783:
  
  Remove duplicate if-statement on gmt_is_set in gmtsub().
  
  r196587:
  
  MFC of tzcode2009k
  
  zic.c:
  Do not end a binary file with a POSIX-style time zone string
  for locations that end up in permanent DST (thanks to Andreas
  Schwab).

Deleted:
  stable/7/usr.sbin/zic/Arts.htm
  stable/7/usr.sbin/zic/tz-art.htm
  stable/7/usr.sbin/zic/tz-link.htm
Modified:
  stable/7/lib/libc/   (props changed)
  stable/7/lib/libc/stdtime/asctime.c
  stable/7/lib/libc/stdtime/difftime.c
  stable/7/lib/libc/stdtime/localtime.c
  stable/7/lib/libc/stdtime/private.h
  stable/7/lib/libc/stdtime/strftime.c
  stable/7/lib/libc/stdtime/time2posix.3
  stable/7/lib/libc/stdtime/tzfile.5
  stable/7/lib/libc/stdtime/tzfile.h
  stable/7/usr.sbin/zic/   (props changed)
  stable/7/usr.sbin/zic/README
  stable/7/usr.sbin/zic/Theory
  stable/7/usr.sbin/zic/ialloc.c
  stable/7/usr.sbin/zic/private.h
  stable/7/usr.sbin/zic/scheck.c
  stable/7/usr.sbin/zic/zdump.8
  stable/7/usr.sbin/zic/zdump.c
  stable/7/usr.sbin/zic/zic.8
  stable/7/usr.sbin/zic/zic.c

Modified: stable/7/lib/libc/stdtime/asctime.c
==
--- stable/7/lib/libc/stdtime/asctime.c Mon Aug 31 00:56:06 2009
(r196682)
+++ stable/7/lib/libc/stdtime/asctime.c Mon Aug 31 02:22:18 2009
(r196683)
@@ -1,12 +1,18 @@
 /*
 ** This file is in the public domain, so clarified as of
-** 1996-06-05 by Arthur David Olson (arthur_david_ol...@nih.gov).
+** 1996-06-05 by Arthur David Olson.
+*/
+
+/*
+** Avoid the temptation to punt entirely to strftime;
+** the output of strftime is supposed to be locale specific
+** whereas the output of asctime is supposed to be constant.
 */
 
 #include sys/cdefs.h
 #ifndef lint
 #ifndef NOID
-static charelsieid[] __unused = @(#)asctime.c 7.9;
+static charelsieid[] __unused = @(#)asctime.c 8.2;
 #endif /* !defined NOID */
 #endif /* !defined lint */
 __FBSDID($FreeBSD$);
@@ -19,7 +25,57 @@ __FBSDID($FreeBSD$);
 #include tzfile.h
 
 /*
-** A la ISO/IEC 9945-1, ANSI/IEEE Std 1003.1, Second Edition, 1996-07-12.
+** Some systems only handle %.2d; others only handle %02d;
+** %02.2d makes (most) everybody happy.
+** At least some versions of gcc warn about the %02.2d;
+** we conditionalize below to avoid the warning.
+*/
+/*
+** All years associated with 32-bit time_t values are exactly four digits long;
+** some years associated with 64-bit time_t values are not.
+** Vintage programs are coded for years that are always four digits long
+** and may assume that the newline always lands in the same place.
+** For years that are less than four digits, we pad the output with
+** leading zeroes to get the newline in the traditional place.
+** The -4 ensures that we get four characters of output even if
+** we call a strftime variant that produces fewer characters for some years.
+** The ISO C 1999 and POSIX 1003.1-2004 standards prohibit padding the year,
+** but many implementations pad anyway; most likely the standards are buggy.
+*/
+#ifdef __GNUC__
+#define ASCTIME_FMT%.3s %.3s%3d %2.2d:%2.2d:%2.2d %-4s\n
+#else /* !defined __GNUC__ */
+#define ASCTIME_FMT%.3s %.3s%3d %02.2d:%02.2d:%02.2d %-4s\n
+#endif /* !defined __GNUC__ */
+/*
+** For years that are more than four digits we put extra spaces before the year
+** so that code trying to overwrite the newline won't end up overwriting
+** a digit within a year and truncating the year (operating on the assumption
+** that no output is better than wrong output).
+*/
+#ifdef __GNUC__
+#define ASCTIME_FMT_B  %.3s %.3s%3d %2.2d:%2.2d:%2.2d %s\n
+#else /* !defined __GNUC__ */
+#define ASCTIME_FMT_B  %.3s %.3s%3d %02.2d:%02.2d:%02.2d %s\n
+#endif /* !defined __GNUC__ */
+
+#define STD_ASCTIME_BUF_SIZE   26
+/*
+** Big enough for something such as
+** ??? ???-2147483648 -2147483648:-2147483648:-2147483648 -2147483648\n
+** (two three-character abbreviations, five strings denoting